Description
Trying to display GIFs. Just get white rectangle but can see it is sending repeated SPI data so almost there!
What MCU/Processor/Board and compiler are you using?
Teensy 4.1
What LVGL version are you using?
Master 8.1.1
What do you want to achieve?
Display GIFs!
What have you tried so far?
Installed “lv_lib_gif/lv_gif.h” and the examples and the example.gif file on SD Card
I’ve also tried using the compiled version of the gif also in the example not using SD Card.
Some aspects of the documentation seem incompatible with 8.1.1?
Code to reproduce
I’m using the supplied example.gif in the lv_lib_gif library which is on the SD Card. I have this set:
/*GIF decoder library*/
#define LV_USE_GIF 1
The example from the MASTER documentation says use:
lv_obj_t *img = lv_gif_create(lv_scr_act());
/* Assuming a File system is attached to letter 'A'
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
lv_gif_set_src(img, "S:example.gif");
lv_obj_align(img, LV_ALIGN_RIGHT_MID, -20, 0);
But lv_gif_create() and lv_gif_set_src() are not in the lv_lib_gif/lv_gif.c library??
All that has is:
lv_obj_t * lv_gif_create_from_file(lv_obj_t * parent, const char * path)
So, I have tried:
lv_obj_t *img = lv_img_create(lv_disp_get_scr_act(NULL));
lv_gif_create_from_file(img, "S:example.gif");
lv_obj_center(img);
That compiles, runs, finds the file and draws a rectangle on the screen at 33fps and 10% CPU load with lots of continuous SPI activity, so I can see it is trying, but it is just a white rectangle.
I’m assuming this is because the img type is wrong? But lv_obj_t *img = lv_gif_create(lv_scr_act()); will not compile.
What am I missing? Have I loaded the wrong gif library from LVGL Github?
https://github.com/lvgl/lv_lib_gif
Thank you very much for your help.