I have a WPF application that uses a component that sends a bitmap to my application as they appear, I get these bitmaps in the deletion that I pass to this component.
I created a new thread for this process, and it works very well, bitmaps come as a MemoryStream, and I just create a BitmapSource object from this thread inside the method call Dispatcher.BeginInvoke. After I have a BitmapSource object, I add them to the StackPanel so that the user can see the queue of images available for work. So far so good ...
The problem is that these bitmaps are quite large, for example 3000x2000 + pixels, and it takes about 50 ~ ms to create these bitmaps and add to the queue, and when this code is executed, onde inside the BeginInvoke call, it blocks the user interface for this time, causing a very annoying behavior, (to reproduce this, just call Thread.Sleep(50)every 5 seconds).
How can I fix this so that the user always responds?
thanks!
source
share