Skip to main content
SKham.2
Associate II
June 16, 2022
Question

Load PNG or ARGB8888 from a file to TouchGFX

  • June 16, 2022
  • 3 replies
  • 1648 views

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

This topic has been closed for replies.

3 replies

MM..1
Chief III
June 16, 2022
SKham.2
SKham.2Author
Associate II
June 17, 2022

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 III
June 17, 2022

Is for any bitmap object , only change type.

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