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 » Community » Newbie corner » Displaying raw image data
Re: Displaying raw image data [message #39781 is a reply to message #39780] Fri, 26 April 2013 11:22 Go to previous messageGo to previous message
Zbych is currently offline  Zbych
Messages: 327
Registered: July 2009
Senior Member
It is quite easy. You just have to create ImageBuffer:

ImageBuffer ib(image_width, image_height); 


And fill it with new pixels:

for (int y = 0; y < ib.GetHeight(); y++) {
	RGBA * dst = ib[y];
	for (int x = 0; x < ib.GetWidth(); x++) {
		dst->b = conversion from source - blue;
		dst->g = conversion from source - green;
		dst->r = conversion from source - red;
		dst->a = 255;
		dst++;
	}
}


And after that you can convert it to Image.
Image img = ib;
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: compiling with MSC 10
Next Topic: ScatterCtrl / ScatterDraw - ShowLegend() problem and general Question
Goto Forum:
  


Current Time: Sat Jul 05 23:51:02 CEST 2025

Total time taken to generate the page: 0.02816 seconds