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?