2026-05-22 9:40 AM - last edited on 2026-05-22 9:48 AM by Andrew Neil
Hey,
I have my images stored compressed (ARGB8888) on NAND flash accessed via FileX. Not memory mapped, so I need to cache everything before starting the GUI.
I noticed this in the Bitmap API docs:
Bitmap::decompress — "This method is called by Bitmap::cache when required."
So does that mean I just implement BlockCopy with FileX, call Bitmap::cache(), and it handles the decompression automatically? Does it allocate for the uncompressed size and deal with the temp buffers internally?
Would save me a lot of headache if that's the case;
Thanks!
2026-05-22 9:41 AM
Is this a TouchGFX question?
2026-05-22 9:44 AM
2026-05-22 9:48 AM - edited 2026-05-22 9:49 AM
OK - moved it to the TouchGFX forum & added the label.
2026-05-26 4:40 AM
Hey,
You are right that TouchGFX has built in functionality to decompress and copy your bitmaps into RAM, as long as you implement the blockCopy for your unmapped storage. But the Bitmap::cache function is only for uncompressed bitmaps. For the compressed images you instead need to use the Bitmap::decompress function as described here:
This quote is therefore not true:
Bitmap::decompress — "This method is called by Bitmap::cache when required."
Can you share a link to where you have read this?
Best regards,
Peter
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.