c# - WPF: How do I prevent tearing with WriteableBitmap? -


I am using images to display which I process myself at approximately 20 frames per second.

This question ()
and this question ()
indicates that the best way to do this is to use a WriteableBitmap

WriteableBitmap indicates that the call to write WritePixels () will be due to the thread rendering thread on the UI thread:

MSDN documentation:
The UI thread writes content back in the buffer. The render thread reads the contents in front buffer and copies it to video memory. The changes made in the back buffer are tracked with changing rectangular areas.

& lt; Snap />

When an update is sent to the rendering thread, the rendering thread copies the rectangles converted from backup buffers to the front buffer. The rendering system controls this exchange to prevent circumvention and to recreate artifacts, such as "torn".

I process my images on a background thread, then use Dispatcher.BeginInvoke () to call WritePixels () , To make sure that WritePixels () is called on the UI thread.

I still feel torn with writeable bitmap , and on which I am working, it looks terrible (its medical imaging app). Is there anything I can do?

After "text" itemprop = "text">

There was a lot of putting in WriteableBitmap to avoid tearing, but on some system configurations It is inevitable that this will mostly close Windows XP or Vista w / Aero (DWM).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -