Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
lindquist is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: StreamRaster::LoadAnyFile -- not exist in distribution?
Next Topic: Draw Objects with Wallpapers, ...
Goto Forum:
  


Current Time: Sun Jun 02 19:29:50 CEST 2024

Total time taken to generate the page: 0.00397 seconds