2022-03-23 02:10 AM
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
2022-04-06 01:34 AM
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
2022-04-07 05:48 AM
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