Important: unclear posts may not receive useful answers.
Before posting
- Get familiar with Markdown to format and structure your post
- Be sure to update lvgl from the latest version from the
master
branch.- Be sure you have checked the FAQ and read the relevant part of the documentation.
- If applicable use the Simulator to eliminate hardware related issues.
Delete this section if you read and applied the mentioned points.
Description
How do I use the new JPEG decoder in lvgl to display an Image on the screen?
What MCU/Processor/Board and compiler are you using?
ESP32-WROOM
What LVGL version are you using?
8.3.7
What do you want to achieve?
Display an image on the screen
What have you tried so far?
I have tried to use the decoder using the lv_img functions that are supposed to automatically use the decoder. I have defined the LV_USE_SJPG, the screens are being loaded but I can’t figure out how to display images on my 240x240 screen (GC9A01). Thanks!
Code to reproduce
void setup(){
//Initialized buffer and initialized lvgl
lv_obj_t* main_screen = lv_obj_create(NULL);
lv_scr_load(main_screen);
lv_obj_set_style_bg_color(main_screen,lv_palette_main(LV_PALETTE_AMBER),0); // This is a check to screen has been loaded.
lv_obj_t *img_obj = lv_img_create(main_screen);
lv_img_set_src(img_obj,"space.jpg");
lv_obj_set_pos(img_obj,0,0);
lv_obj_set_size(img_obj,100,100);
lv_scr_load(main_screen);
}
void loop(){
lv_task_handler();
}