SetSource with BMP file

Sep 6, 2013 at 2:35 PM
This has to do with the WriteableBitmap base class, but I was hoping someone could answer my question:

Why does this code work for PNG and JPG files but not BMP?
      WriteableBitmap wb = new WriteableBitmap(1500, 1500);
For BMP files I get the following error on SetSource: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Sep 9, 2013 at 7:05 AM
The BitmapImage / WB does not support BMP.
But BMP is easy enough to parse, so you can roll your won Bmp Reader or use an open source one. I'm pretty sure someone wrote a BitmapImage / Wb method that support BMP.

But you should really think about if BMP is needed, BMPs are huge!
  • Rene