Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » saving a paletted PNG
Re: saving a paletted PNG [message #6069 is a reply to message #6067] |
Sun, 29 October 2006 20:53   |
lindquist
Messages: 33 Registered: March 2006 Location: Denmark
|
Member |
|
|
this is basically what I'm doing: (greatly simplified)
void writePNG(const String& filename)
{
Vector<Color> pal;
pal.Add(Color(0,0,0));
PixelArray pix(100, 100, 8, 1, NULL, pal);
for (int i=0; i<10000; ++i)
pix.pixels[i] = 0;
Image img = PixelArrayToImage(pix);
PngEncoder::New()->SaveImageFile(filename, img);
}
[Updated on: Sun, 29 October 2006 20:54] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu May 01 18:45:56 CEST 2025
Total time taken to generate the page: 0.04142 seconds
|