U++ framework
Do not panic. Ask here before giving up.

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: 1267
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 Jun 23 15:24:52 GMT+2 2026

Total time taken to generate the page: 0.00494 seconds