cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX and dynamic bitmap

Luca G.
Associate III

Hello to all,

I am developing an application in which I have to dynamically draw an image on the display.

Looking online I found that the most adopted solution is to use dynamicBitmaps but I also saw that you can directly use the frame buffer with

HAL::getInstance()->lockFrameBuffer();
HAL::HAL::getInstance()->unlockFrameBuffer();

Which of the two solutions is more recommended or when to use one rather than another solution?

Thanks in advance.

1 REPLY 1
Martin KJELDSEN
Chief III

I'm not quite sure which one you want when you say "dynamically draw an image on the display".

DynamicBitmaps are typically used when you cannot place images in addressable memory (qspi, e.g.) or you need to convert images (png, jpg) on the fly.

You "lock" the framebuffer if you want to manipulate what's in there. For instance, if you check the Lens Example from the touchgfx designer you'll see an example of how to create a dynamic lens effect by taking a lock on the framebuffer and writing directly to it.

/Martin