Search code examples
c#wpfwriteablebitmap

How to clear a WriteableBitmap


I have a WriteableBitmap which I would like to repeatedly clear and redraw.

I have seen references to writing to the Pixels array directly, but the Pixels array is not accessible in WriteableBitmap. I have also tried the suggestion of recreating the WriteableBitmap each time, but my app runs out of memory almost immediately.

Is there a simple way to clear a WriteableBitmap?


Solution

  • To use the writeablebitmap.clear() you need the WriteableBitmapEx library. http://writeablebitmapex.codeplex.com