ispiro ispiro - 1 month ago 9
C# Question

Can WriteableBitmap only be written-to once?

I'm setting an

Image
's
Source
to a
WriteableBitmap
, and I'm populating that
WriteableBitmap
using its
PixelBuffer
. The first time I write to it, it works. But subsequent writes are ignored. Why?

I'm using:

Stream s = myWriteableBitmap.PixelBuffer.AsStream()


(it's in a
using
. and I'm not getting any exceptions)

Answer

Following Rob Claplan's answer you should call Invalidate after performing changes to your Bitmap.