Xinyuan-LilyGO / LilyGo-T-RGB

MIT License
82 stars 26 forks source link

Load a jpg from SD card with Lvgl #20

Closed Revoxdyna closed 8 months ago

Revoxdyna commented 1 year ago

Hi All,

I am struggling to load a jpg from SD with lvgl library. I modified the lv_conf.h

  1. enable the file system.
    #define LV_USE_FS_FATFS 1
    #if LV_USE_FS_FATFS
    #define LV_FS_FATFS_LETTER 'S'     /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
    #define LV_FS_FATFS_CACHE_SIZE 460800    /*>0 to cache this number of bytes in lv_fs_read()*/
    #endif
  2. enable the jpg encoder
    /* JPG + split JPG decoder library.
    * Split JPG is a custom format optimized for embedded systems. */
    #define LV_USE_SJPG 1
  3. and add the following to load the image
    lv_fs_fatfs_init();
    lv_obj_t * img_src = lv_img_create(lv_scr_act()); /*Crate an image object*/
    lv_img_set_src(img_src, "S:/logo_480.jpg");

    I am not able to get the image show on the screen but I can open and read a text file without a problem. Could I have sketch or example to get that work for ESP32?

Thanks

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 8 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.