DynamicBitmapCreateExternal() for RGB565
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-15 1:08 PM - last edited on ‎2025-05-30 1:56 AM by LouisB
Hi, I am creating a DynamicBitmapCreateExternal() for RGB565, but the image shows up faded. Is there any fix for this? I made sure to set cache for it. I also tried for L8 and it didn't show.
Solved! Go to Solution.
- Labels:
-
TouchGFX
-
TouchGFX Designer
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-22 11:11 AM
I just tried with RGB888 and it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-19 2:19 AM
Hello @Priyank ,
If the image looks faded / pastel color / lighter color, perhaps it is a color format issue.
Can you please share more information with us?
Are you able to make a "regular" DynamicBitmap work?
Can you share your code and images of the result and expected result?
Regards,
Software engineer at ST (TouchGFX)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-19 7:44 AM - edited ‎2025-05-19 7:48 AM
Yes, it works with regular dynamic bitmap.
FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap)
: FrontendApplicationBase(m, heap)
{
static uint16_t cacheSize[512];
Bitmap::setCache(cacheSize, sizeof(cacheSize),1);
}
void LandingView::setupScreen()
{
bmpId = Bitmap::dynamicBitmapCreateExternal(146, 36,(void*)0x90FC0000, Bitmap::RGB565);
logo.setBitmap(Bitmap(bmpId));
add(logo);
logo.setXY(20,20);
}
The address is where I have the image stored (QSPI). This code worked when using a regular bitmap cache and dynamic bitmap create. Logo here is a Image widget.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-19 7:59 AM
Ok great!
Do you specifically need to use DynamicBitmapCreateExternal() or is DynamicBitmap enough?
Regards,
Software engineer at ST (TouchGFX)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-19 8:01 AM
The situation is that there is limited Ram Capacity, and the DynamicBitmapCreateExternal function allows for an image stored in flash to be displayed at runtime so the goal was to use that. I wanted to avoid carving out x KB of RAM for an image when it can be read from flash.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-21 1:23 AM
Hello @Priyank ,
Going back to your initial question, someone offers a workaround in this thread : https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/dynamicbitmapcreateexternal-does-not-work-for-a-rgb565-image/m-p/605117/highlight/true#M35160
Regards,
Software engineer at ST (TouchGFX)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-21 10:31 AM - edited ‎2025-05-21 10:32 AM
Hello @GaetanGodart .
Thank you for the workaround. However, it still uses up RAM. I want to read externally. User must still setCache to size of image in the workaround.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-22 2:11 AM
Hello @Priyank ,
You said "DynamicBitmapCreateExternal function allows for an image stored in flash to be displayed at runtime" but any image can be stored in flash and be displayed at runtime.
The DynamicBitmapCreateExternal function is designed to load different assets that the Bitmap data base is not aware of, this is used when people what to create a single application but have different versions of it, for instance for different regions where the assets would be different (text, font, etc).
However, if you just want to display an image (image = bitmap) from flash, you have nothing special to do, just flash that image to external flash.
Can you explain what you want to do exactly?
Do you want to create a new image (by taking a picture for instance) and display that image?
Also, can you try to use another format than RGB565 and see if it works?
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-22 10:46 AM
Hello @GGODA
The current use case is that the application will have a Logo displayed on multiple screens. However, each user should be able to upload their own logo and have that display (at run time). So this image which is uploaded will be converted to RGB565 and flashed to external QSPI. Bitmap Database will not have any knowledge of this image. I want to be able to display the users Logo at runtime. I tried the L8 format and it did not work at all. Regular 565 showed up faded. The workaround @GaetanGodart provided works, however it uses up the RAM to create the dynamic bitmap.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-05-22 11:11 AM
I just tried with RGB888 and it worked.
