开发者

Is ImageBrush able to work multithreaded?

开发者 https://www.devze.com 2023-03-18 00:17 出处:网络
I am working on WPF with images. When calling an Image control to set the imageSource it is needed to use the dispatcher if image comes from different thread instead of the GUI thread.

I am working on WPF with images. When calling an Image control to set the imageSource it is needed to use the dispatcher if image comes from different thread instead of the GUI thread.

I just wonder if I can set an ImageBrush instead to wor开发者_StackOverflowk multithreaded.

Regards


No, it is not the image but the whole WPF framework that is not thread-safe.

So any manipulation to the GUI has to be from the main thread (Dispatched).


If you call Freeze() on the ImageBrush, you can use it in multiple threads. You can only access the Image Control in the main thread though.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号