How to use image c file


i convert my image to c file,please give some guidance to display image c file.

What MCU/Processor/Board and compiler are you using?

What LVGL version are you using?


What do you want to achieve?

What have you tried so far?

Code to reproduce

The code block(s) should be formatted like:

 const lv_img_dsc_t lv_logo_payment = {
      .header.always_zero = 0,
      .header.w = 80,
      .header.h = 80,
      .data_size = 6400 * LV_COLOR_SIZE / 8, = LV_IMG_CF_TRUE_COLOR,
      .data = lv_logo_payment_map,
    lv_obj_t* icon = lv_img_create(lv_scr_act(), NULL);

    /*From variable*/
    lv_img_set_src(icon, &lv_logo_payment);

Screenshot and/or video

I’m new to LVGL too, havn’t use images yet :grinning: . Maybe you expected too much from me.

As general guidance, try to find some help from the examples’ source code, even dig deep to the widgets source code. It’s not as hard as you think it would be.

Another suggestion is to read the online documents first. It’ll not cosume as much time as you think.

I suggest that you first download simulator and run the examples. Then try your code in one of those examples. I can’t give you a link but to start google “lvgl simulator on pc”.

i display image by c file now.

i want to create a dynamic menu,would you give some guidance?