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 » Single Pixel Wide Straight Lines
Re: Single Pixel Wide Straight Lines [message #59021 is a reply to message #59012] Sat, 15 October 2022 09:23 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1093
Registered: August 2007
Senior Contributor
Quote:
is there a way to paint pixels in an array or buffer or something so I can do that my self.


Yes. ImageBuffer allows direct access to its RGBA buffer.

e.g:
	void Paint(Draw& w) override
	{
		Size sz = GetSize();
		w.DrawRect(sz, Black());
		ImageBuffer canvas(sz);
		
		for(int y = 0; y < sz.cy; y++) {
			for(int x = 0; x < sz.cx; x++) {
				if((y % 16 == 0) || (x % 16 == 0))
					canvas[y][x] = White();
			}
		}
		w.DrawImage(0, 0, canvas);
		
	}


is possible.

Best regards,
Oblivion


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Text painting issue with 'const char*'
Next Topic: Crash when loading some jpeg files
Goto Forum:
  


Current Time: Tue May 07 15:12:27 CEST 2024

Total time taken to generate the page: 0.02224 seconds