cancel
Showing results for 
Search instead for 
Did you mean: 

Load PNG or ARGB8888 from a file to TouchGFX

SKham.2
Associate II

Hello,

I would like to know if it is possible to load a transparent format such as PNG or ARGB8888 from a file to TouchGFX from code?

I have achieved to do this with BMP with the documentation but I need PNG.

If I use a library such as libspng to decode the png file to rgba8888, i would need to flip bits to argb8888 right?

From my understanding, this are the functions that I would need to translate to make it works:

  •    BMPFileLoader::getBMP24Dimensions(&MyFile, width, height);

but for PNG to extract the width and height by reading the header of the png file.

Then:

  • BMPFileLoader::readBMP24File(Bitmap(bmpId), &MyFile);

For this function, I have no idea how to process.

Another option would be to load a ARGB8888 so the MCU wouldn't need to decode the PNG but still I would need to create a readARGB8888File() function that translate a ARGB8888 file to a Bitmap object of TouchGFX that I have no idea how to do.

Best regards,

skham

3 REPLIES 3
MM..1
Chief II
SKham.2
Associate II

I have seen this, of course, but it is for opaque format and I need a transparent one such as PNG or ARGB8888.

MM..1
Chief II

Is for any bitmap object , only change type.

bmpId = Bitmap::dynamicBitmapCreate(100, 150, Bitmap::RGB565);