Skip to main content
December 12, 2020
Question

How to work with pixels?

  • December 12, 2020
  • 2 replies
  • 920 views

Hello!

I put to project a widget box1, it's color is white.

I want to set color of each pixel of box

like this: SetPixel(x,y, R,G,B);

And after I want to read color of pixel? like this: color=GetPixel(x,y);

How can I do it in TouchGFX?

This topic has been closed for replies.

2 replies

Alexandre RENOUX
Visitor II
December 14, 2020

Hello,

There's not such feature for the box widget.

If you want to change each pixel on the screen, one way would be to retrieve the pointer of the framebuffer and write directly the values you need.

You can retrieve the framebuffer pointer by calling lockFramebuffer() (see link)

/Alexandre

December 14, 2020

No... working with buffer is not good idea.

I want to change pixel on coordinates X,Y of widget, and then I want to move widget to new coordinates. What widget can I get, to draw on it's (widget's) canvas?