Reputation: 268
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.
Upvotes: 0
Views: 6163
Reputation: 166
You could always use .NET.
I would suggest the built in System.Drawing namespace, which is available in both flavors - C++ and C#. Assuming you aren't against using Visual C++ Express, you can always take it from there.
Here's a link to the "official" documentation: System.Drawing Namespace
Within which is the System.Drawing.Graphics namespace, which is possibly what you would want to use.
AND here's a link to a nice little tutorial that will teach you how to import an image and draw on it (or possibly even draw it onto a bitmap): The Wonders of System.Drawing.Graphics
Upvotes: 1
Reputation: 21
I created a kluge to do this. I used a common routine for getting the color (GetColor(red,green,blue,transparency)). I printed in two passes. The first pass would print to a 256 gray scale image. GetColor() would return the transparency as a shade of gray. The second pass would print to a 24-bit color image. GetColor would return the RGB color. After the two passes I merged the two bitmaps with the grayscale becoming the alpha channel for the PNG file.
Upvotes: 2
Reputation: 1838
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.
Upvotes: 2
Reputation: 106549
C++ does not have any facilities built in for editing images. You'd need to find a library.
Upvotes: 1