lvgl / lv_port_pc_visual_studio

Visual Studio projects for LVGL embedded graphics library. Recommended on Windows. Linux support with Wayland is work in progress.
MIT License
552 stars 282 forks source link

display error with indexed image #43

Closed fo2w closed 2 years ago

fo2w commented 2 years ago

branch: master

code to reproduce:

    // img_name_map is a c_array here with raw data
    // I random pick a PNG file and use the online tool (https://lvgl.io/tools/imageconverter) to generate it

    const lv_img_dsc_t img_name = {
      .header.cf = LV_IMG_CF_INDEXED_4BIT,
      .header.always_zero = 0,
      .header.reserved = 0,
      .header.w = 40,
      .header.h = 40,
      .data_size = 864,
      .data = img_name_map,
    };

    LV_IMG_DECLARE(img_name);
    lv_obj_t* icon = lv_img_create(lv_scr_act());
    lv_img_set_src(icon, &img_name);
    lv_obj_set_size(icon, 40, 40);

expected result: show the CORRECT image on the top left of the main window

actual result: image

kisvegabor commented 2 years ago

Is it related to the windows port or LVGL in general?

EDIT: it works for me in Eclipse with the latest LVGL.

MouriNaruto commented 2 years ago

@kisvegabor @fo2w

I have reproduced the issue and solved it by updating the LVGL version to the latest.

image

Kenji Mouri

fo2w commented 2 years ago

By updating the LVGL version to the latest, now it works well. Thank you guys.