Skip to main content
livio
Associate II
November 3, 2016
Question

How can I import image in C code ?

  • November 3, 2016
  • 3 replies
  • 972 views
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
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    November 4, 2016
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    AvaTar
    Senior III
    November 4, 2016
    Posted on November 04, 2016 at 09:37

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

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

    Thank you very much.