Inquiries when uploading images


I’m sorry, but I’m really a beginner

Q1. How many files open when uploading one image?
I am uploading a converted image from png to bin file.
But I am trying to open the file 3 times
Repeat file open/close

Is this a problem-free operation?


After “lv_img_create()” command

-> file open(test img 1)
-> file close(test img 1)

After “lv_img_set_src()” ,“lv_obj_set_pos()” command

-> file open(test img 1)
-> file close(test img 1)
-> file open(test img 1)
-> file close(test img 1)

File open/close is repeated 3 times

Q2. I want to make a scene by uploading about 50 files on one screen.
At this time, should 50 obj be created?


lv_obj_t * img_test1;
lv_obj_t * img_test2;
lv_obj_t * img_test3;

img_test1 = lv_img_create(lv_scr_act(), NULL);
img_test2 = lv_img_create(lv_scr_act(), NULL);
img_test3 = lv_img_create(lv_scr_act(), NULL);

lv_img_set_src(img_test1, “C:/img_test1.bin”);
lv_img_set_src(img_test2, “C:/img_test2.bin”);
lv_img_set_src(img_test3, “C:/img_test3.bin”);


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

CPU : TI AM57xx
custom board

What LVGL version are you using?

LVGL version : 6

Yes, no problem with that.

Yes, by default you need to create 50 objects. Creating 50 images is a special case, and probably there is a more optimal solution for your case. But it’d require a custom widget tailored to your needs.

1 Like