cancel
Showing results for 
Search instead for 
Did you mean: 

Can I manually update parts of my screen with touchgfx?

ABricout
Associate III

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

2 REPLIES 2
Yoann KLEIN
ST Employee

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 KLEIN
ST Software Developer | TouchGFX
ABricout
Associate III

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