cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Dynamically Update Image

GuillaumeB
Associate II

Hi team,

I was wondering if it is possible to have TouchGFX update an image on the fly. For instance, updating the `path` of a SVG and refresh the image dynamically.

From the APIs it looks like everything has to be static since all assets are compiled into C++ files, but I wanted to see if there's a way to update images in general.

Thank you!

-Guillaume

2 REPLIES 2

Hello @GuillaumeB ,

Unfortunately, no you can not introduce new images while an application is running on the board, because they have to be compiled into objects and written to the flash memory of the board. 
However, you can update an image through the application to show different images, for instance, when you click a button. This way, you first need to add all the images you want to use through the designer, and then use 'setBitmap' or 'setSVG' functions to update the images. 
There are multiple examples to see this functionality, and you can read more about them here:
https://support.touchgfx.com/docs/api/classes/classtouchgfx_1_1_image
https://support.touchgfx.com/4.21/docs/api/classes/classtouchgfx_1_1_s_v_g_image

I hope I have answered your question. Feel free to ask more 

Mohammad MORADI
ST Software Developer | TouchGFX
MM..1
Chief II

Anythink in changeable memory can be changed, but in render systems require invalidate refresh full object... not most efective.

Dynamic Bitmaps | TouchGFX Documentation