2020-09-15 10:54 AM
I'm using TouchGFX's dynamicBitmaps to load an image that I have in a buffer.
The problem is that, even just using the example I found at this link https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/dynamic-bitmaps:
BitmapId bmpId;
//Create dynamic bitmap
const int width = 32;
const int height = 24;
bmpId = Bitmap::dynamicBitmapCreate(32, 24, Bitmap::RGB565);
//set all pixels white
if (bmpId != BITMAP_INVALID)
{
memset(Bitmap::dynamicBitmapGetAddress(bmpId), 0xFF, width*height*2);
}
//Make Image widget show the dynamic bitmap
image.setBitmap(Bitmap(bmpId));
//Position image and add to View
image.setXY(20, 20);
container1.add(image);
and I set up the cache in the constructor of view as follows:
.
.
.
uint32_t bitmapCache[32 * 24 * 3];
.
.
.
Bitmap::setCache((uint16_t*)bitmapCache, sizeof(bitmapCache), 1);
.
.
.
As soon as the container where I add the dynamicBitmap appears (in this case I do it in the setupScreen function and assign the image to a container that is in a swipe container) the firmware crashes at the code point shown in the image below:
What could be the problem?
I hope I was clear.
Regards
Solved! Go to Solution.
2020-09-15 01:51 PM
Looks like you're hitting an assert in LCD24bpp beause you're trying to create a RGB565 dynamic bitmap when you're expected to use a format like RGB888 for 24-bit (or even ARGB8888).
/Martin
2020-09-15 01:51 PM
Looks like you're hitting an assert in LCD24bpp beause you're trying to create a RGB565 dynamic bitmap when you're expected to use a format like RGB888 for 24-bit (or even ARGB8888).
/Martin
2020-09-22 10:15 AM
Thank you very much @Martin KJELDSEN and sorry for delay.
I solved my problem!
2020-09-22 11:00 PM
That's great news :) Awesome!