C++ – How to create PNG images with Visual Studio C++ 2010


IN: Visual Studio 2010 Ultimate, Windows 7

OUT: Some small ish PNG images that I will use as custom markers in Google Maps.

Language: C++ (or, if I really have to, C#)

Extra: I need to be able to plot the alpha channel (the transparency). I used PNGwriter library on a Linux machine and that didn't offer this feature.

Extra 2: The .exe will run on a server each time a new custom marker is needed. (Markers have different colors and shapes)

Edit: 1. I want to create a new image. 2. I need a library which I can't seem to find via Google yet.

Best Solution

Do you mean you want to convert from one file format to PNG using C++? Or that you want to render to an image and save the resulting image out as a PNG?

Either way, maybe you should take a look at FreeImage http://freeimage.sourceforge.net/features.html which is an open source image parsing/writing library that supports many formats, including PNG.