Hello guys! I recently tried to ported LVGL to vexcode text (I use VEX Expenision in VSCode), by using James Pearman’project.It really helps me a lot, because it helps me to display imgs without a SDCard.
If I don’t use gif, it worked out pretty well. However,when it comes to gif playing.I screwed up.Even if I change the lv_conf.h ,the gif just can’t be played.
Here is GIF Function code:
void PicShow(){
LV_IMG_DECLARE(bad_apple_cut_raw); //I use the online imageconverter from offical
lv_obj_t* img = lv_gif_create(lv_scr_act()); //I'll talk about that later
lv_gif_set_src(img, &bad_apple_cut_raw);
lv_obj_align(img, LV_ALIGN_CENTER, 0, 0);
}
Here is my code to call the function:
///this int function runs in a muti-task.It works fine
int PreAutoChart(){
//========== LVGLTest ==============
v5_lv_init();
ShootButton();
DropListShow();
TeamName();
PicShow();
while(!game_start) {
this_thread::sleep_for(10);
}
return 0;
}
Just like what I have mentioned in the code. “bad_apple_cut_raw” is a "c file ",which I get from Online image converter - BMP, JPG or PNG to C array or binary | LVGL
I transform my gif in settings like this,
exactly the way as the offical docs says.
However, when I download the program and run it ,I looks like this:
The GIF disapper for no reason.But if I use the demo provided by LVGL Offical,it works fine.
Here is the code:
void PicShow(){
LV_IMG_DECLARE(img_bulb_gif);
lv_obj_t * img;
img = lv_gif_create(lv_scr_act());
lv_gif_set_src(img, &img_bulb_gif);
lv_obj_align(img, LV_ALIGN_LEFT_MID, 20, 0);
}
This has bothered me for 2 days.And I still have no ideas about how to solve it.Pleas help!
I really want to use cutom gif.