How to release an image which was displayed in an image column?

5 posts, 0 answers
  1. Markus
    Markus avatar
    12 posts
    Member since:
    Nov 2013

    Posted 31 Jul 2014 Link to this post

    I have a window with a gridview control with an image column. The image column displays PNG files on my local disk.
    Once I'm done with this dialog (after ShowDialog()) I need to remove the images again from disk.
    Unfortunately Windows tells me that the images are still in use by my process although the dialog has been closed successfully (my application still runs of course).

    What do I need to do to be able to remove the PNG files after the dialog has been closed?
    There is no dispose method for WPF windows. What cleanup do I need to do in the closed event?

    Thanks for your help.

    Markus

  2. Markus
    Markus avatar
    12 posts
    Member since:
    Nov 2013

    Posted 04 Aug 2014 in reply to Markus Link to this post

    Any thoughts anybody?

    I really need to rename the image file once I'm done with the dialog, but the images are still locked by my process.

    Thanks,
    Markus
  3. Yoan
    Admin
    Yoan avatar
    1214 posts

    Posted 04 Aug 2014 Link to this post

    Hi Markus,

    I believe that you will find the How to force Image control to close the file that it opens in wpf stackoverflow's article useful.

    Please let me know how it works for you.

    Regards,
    Yoan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  4. Markus
    Markus avatar
    12 posts
    Member since:
    Nov 2013

    Posted 06 Aug 2014 Link to this post

    Hi Yoan,

    thanks a lot for your hint. That was exactly what I was missing. Now it works as needed.

    Best regards,
    Markus
  5. Yoan
    Admin
    Yoan avatar
    1214 posts

    Posted 06 Aug 2014 Link to this post

    Hi Markus,

    I am glad to hear this. Don't hesitate to contact us if you have other questions.

    Regards,
    Yoan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top