Skip to main content
ABricout
Associate III
March 23, 2022
Question

Can I manually update parts of my screen with touchgfx?

  • March 23, 2022
  • 2 replies
  • 969 views

Hello,

I am developing an app with TouchGFX that has a map. I would like to draw the path the user went on the map.

I am looking for a way to change some pixels colour manually. I thought of using a manual bitmap image, but it comes in front of the maps and hides it. The nice way would be to be able to set some pixels in the screen to black on the coordinates of the path, but I can’t find how to do that.

Do you have a method or an idea of how I could make it work?

Thank you by advance

Augustin

This topic has been closed for replies.

2 replies

Yoann KLEIN
ST Employee
April 6, 2022

Hello @ABric.1​ ,

I recommend you to look at the "Custom Widget Example" in TouchGFXDesigner.

This example implements a draggable lens on the screen, which distorts the text located below.

Please take a look at the Lens.cpp class, and more especially at the draw(const touchgfx::Rect&) and apply(uint16_t*, int, int, int, int) methods. You will understand that you can call the lockFrameBuffer() function, apply your modifications on the FrameBuffer (e.g. draw some pixels black), and finally unlock the FrameBuffer by calling unlockFrameBuffer().

Let me know if that helped you,

/Yoann

Yoann KLEINST Software Developer | TouchGFX
ABricout
ABricoutAuthor
Associate III
April 7, 2022

Hello,

Thank you for the idea, I will look in this direction.

I will come back to you when I have the time to test it.

Thanks again,

Augustin