Skip to main content
Luca G.
Associate III
November 19, 2020
Question

TouchGFX and dynamic bitmap

  • November 19, 2020
  • 1 reply
  • 911 views

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.

This topic has been closed for replies.

1 reply

Martin KJELDSEN
Principal III
December 1, 2020

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