Diagram ExportToImage in Background

3 posts, 1 answers
  1. Deepak Shakya
    Deepak Shakya avatar
    118 posts
    Member since:
    Aug 2007

    Posted 15 Dec 2015 Link to this post

    Hi,

     

    Is it possible to process this method in background using BackgroundWorker or some other method using code-behind? My UI seems to freeze when I perform this as I have this hooked up to Diagram_MouseLeave event. It takes time as I have image as item in the background that gets written to a property in Viewmodel.

  2. Answer
    Ivan
    Admin
    Ivan avatar
    44 posts

    Posted 17 Dec 2015 Link to this post

    Hello Deepak Shakya,

    The RadDiagram and it's children(shapes, connections, etc.) are UI elements and they are used by the UI thread. These elements and their properties can only be accessed and modified using the UI thread. Due to this reason the method ExportToImage cannot be processed in another thread as it needs access to properties of the visual elements.

    However, if you need to access the UI thread from another thread you can do this using a Dispatcher. Please note that this will make all calculations in the UI thread.

    Regards,
    Ivan
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
  4. Deepak Shakya
    Deepak Shakya avatar
    118 posts
    Member since:
    Aug 2007

    Posted 17 Dec 2015 in reply to Ivan Link to this post

    Thanks for the answer Ivan. I don't this will work in my situation as it will have to access the UI thread and perform calculation there. I might have to assign this to button_click event.
Back to Top