.netwindows-8.1writeablebitmap

WriteableBitmap.WritePixels not refreshing on some PCs


Very odd issue we have hit with some Windows PCs. We have a video application and one part uses WritePixels to update a WriteableBitmap and display the frames to screen.

Code is:

_currentframe.WritePixels(new Int32Rect(0, 0, data.Width, data.Height),
                          data.Bytes, data.Stride, 0);

NotifyPropertyChanged("CurrentFrame");

(Where 'data' is a wrapper class for our pixel data)

It works fine on 99% of computers. On at least one Windows 8.1 Laptop, the images don't refresh. I don't know why, and everything else works.

I don't understand what would make this fail on some PCs - any suggestions are welcome. Some details of the problem system: Win8.1 (Spanish), net 4.5.50709 (but software uses 4.0).

Graphics Drivers are Intel HD Graphics 4000


Solution

  • We actually have a reproduction of this bug that occurs on some computers in our software to draw high-performance charts. It appears to be an issue with some Intel Graphics drivers and WriteableBitmap / .NET4/4.5.

    See http://www.scichart.com/questions/question/zoom-not-working-properly-on-one-single-computer

    What we believe is happening is the WriteableBitmap once locked/unlocked once is not allowing any further updates. The same code works perfectly well on many other machines and the only other workaround is to disable hardware rendering for the WPF process on systems that exhibit this problem.

    Another workaround is to update the graphics drivers on the target PC with Intel HD Graphics.