2019-09-13 01:37 AM
Hello,
I used the following article to have a dynamic bitmap on the screen:
https://touchgfx.zendesk.com/hc/en-us/articles/207460605-Dynamic-Bitmaps-Load-images-at-runtime
Then I draw a screen in touchgfx designer (attached designer.jpeg) where I would add a background image using dynamic bitmap.
What I actually get is in display.jpeg file (there's some aliasing but the display looks nice), if I press the area where the button are drawn it works, but the button is not visible.
How can I set dynamic bitmaps in background?
Thank you in advance,
Daniele
Solved! Go to Solution.
2019-09-13 06:48 AM
You can't add a dynamic bitmap directly from the designer, but you can add an image placeholder as the background image, add your button, and then later set the bitmap ID for the bitmap to be your dynamic bitmap id. When you invalidate that image it will read the image pixel data from your bitmap cache instead of somewhere in e.g. QSPI.
Does that make sense?
Another way is to reorder the way drawables are added to the view root container:
...
remove(button);
add(dynamicBmp);
add(button);
...
/Martin
2019-09-13 01:39 AM
You must add your dynamic bitmap as the bottom element (The first child of the views root container). The Button must be on top to be visible.
/Martin
2019-09-13 02:24 AM
Thanks for prompt answer.
Do you mean that both button and dynamic bitmap must be added in the designer? How I can add a dynamic bitmap in the designer?
Daniele
2019-09-13 06:48 AM
You can't add a dynamic bitmap directly from the designer, but you can add an image placeholder as the background image, add your button, and then later set the bitmap ID for the bitmap to be your dynamic bitmap id. When you invalidate that image it will read the image pixel data from your bitmap cache instead of somewhere in e.g. QSPI.
Does that make sense?
Another way is to reorder the way drawables are added to the view root container:
...
remove(button);
add(dynamicBmp);
add(button);
...
/Martin
2019-09-16 04:19 AM
Thank you Martin, I tested both these solutions and they work fine.
Daniele
2019-09-16 04:37 AM
You're awesome, @DVale. Great!
/Martin
2020-09-17 05:11 AM
Dear Martin,
So far I could place an image placeholder (with an image stored in the Flash), but I don't know how to change it to point to my ram location where I do have my camera image.
I don't know how to change the bitmap to be dynamic. Can you please provide support to me?
Thanks.