Convert BITMAP to PNG using IImage interface on Windows Mobile

I have a link to a BITMAP structure (HBITMAP) in a Windows Mobile application - I would like to save the bitmap as a PNG file using IImage if possible. (In this situation, there is no BMP file, BITMAP is only in memory).

It looks like I could use IImagingFactory's IImagingFactory :: CreateImageEncoderToFile method to save the file, but I think I needed to get the BITMAP converted to "IImage" format first.

Any ideas on how to do this with your own code?

0


a source to share


1 answer


Use CreateImageFromStream to read BITMAP into your data, which gives you IImage.

Edit:



I've done a little more research on this. There are several ways, but I think the easiest is:

+1


a source







All Articles