cancel
Showing results for 
Search instead for 
Did you mean: 

How can I import image in C code ?

livio
Associate II
Posted on November 03, 2016 at 23:27

Hi

I am doing some experiments with STM32F469I-Discovery, in some example with LCD there are images (e.g. life_augmented_argb8888.h).

How is possible convert an image create with Photoshop in code similar to:

const uint32_t image_name[size]

{

0xFFFFFFFF

...

}

It is possible to handle the transparency?

Thank you

Livio
3 REPLIES 3
Posted on November 04, 2016 at 03:04

You can use basic C File IO (fopen, fread, fclose, etc) to read binary data, and output it in an ASCII format suitable for compilation.

Tools like

https://www.segger.com/emwin-bitmap-converter.html

do this kind of data translation.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
AvaTar
Lead
Posted on November 04, 2016 at 09:37

The free GIMP software always had the capability to export images as C code.

livio
Associate II
Posted on November 05, 2016 at 15:16

Thank you very much.