Hello,
I am attempting to convert a Windows BMP byte stream/array into a PNG format. I am unable to modify how this byte stream comes in.
My attempts:
I've tried using lodepng (http://members.gamedev.net/lode/projects/LodePNG/), but it only supports RGBA format for bitmaps (mine is only BGR, I believe). I've also tried the Windows Imaging Component (http://msdn.microsoft.com/en-us/magazine/cc500647.aspx). However, it gets stuck at this piece of code:
CComPtr<IStream> sourceStream;
sourceStream->Write(bitmap.data.data, bitmap.data.size, NULL);
Here, bitmap.data.data is the BMP byte stream. I'm attempting to write this into the IStream for use with the WIC. However, an assertion fails. It believes that I'm passing it a null array, which I'm not (I have verified this).
I know that my other option is using libpng, but I'm completely confused as to how it works, even after reading the documentation.
Does anyone have any suggestions?