I have a timer and on every tick I want to take an image file from the hard drive and change the image that is being displayed in the Image with this piece if code
Application.Current.Dispatcher.BeginInvoke(
DispatcherPriority.Render,
new Action(() => CameraImageBox.Source =
(ImageSource)new BitmapImage(new Uri(e.FileName))));
The Image control turns pitch black after a couple of dozen of images and the whole ui turns quite unresponsive. How can I avoid the black out and improve the performance over all?
I tried your code in a dispatcher timer (100 milliseocnds delay) that iterates through hundreds of nice 800 * 680 size images at the same
DispatcherPriority.Render.My app seems to be running fine since last 10 minutes.It luks like something else is wrong in your code. Can you provide more details?