I am making a .NET C++ application that loads PNG/TIF images keen on System:: Drawing::Bitmap. However, when I build a new bitmap like this:
Code:
The bitmap I have become has PixelFormat: Format32bppArgb, even though the PNG file format is stored in cargo 1bpp. However, I want the image is loaded into the pixel format of the PNG (1bpp in this situation) because my algorithm assumes that distribution of memory.Bitmap bm = gcnew System:: Drawing::Bitmap(gcnew System:: String("1bpp.png"));
Apart from converting back to 1bpp during charging (which is inefficient), is there any way for me to load the PNG as a bitmap 1bpp directly? Even if you can only get a pointer to the buffer contains the pixel data that you can use this to construct a bitmap, so I want to know if this is possible. I would like to avoid external (non-NET) library if possible.
Bookmarks