acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
gif.md (1350B)
1 ```eval_rst 2 .. include:: /header.rst 3 :github_url: |github_link_base|/libs/gif.md 4 ``` 5 6 # GIF decoder 7 Allow using GIF images in LVGL. Based on https://github.com/lecram/gifdec 8 9 When enabled in `lv_conf.h` with `LV_USE_GIF` `lv_gif_create(parent)` can be used to create a gif widget. 10 11 `lv_gif_set_src(obj, src)` works very similarly to `lv_img_set_src`. As source, it also accepts images as variables (`lv_img_dsc_t`) or files. 12 13 14 ## Convert GIF files to C array 15 To convert a GIF file to byte values array use [LVGL's online converter](https://lvgl.io/tools/imageconverter). Select "Raw" color format and "C array" Output format. 16 17 18 ## Use GIF images from file 19 For example: 20 ```c 21 lv_gif_set_src(obj, "S:path/to/example.gif"); 22 ``` 23 24 Note that, a file system driver needs to be registered to open images from files. Read more about it [here](https://docs.lvgl.io/master/overview/file-system.html) or just enable one in `lv_conf.h` with `LV_USE_FS_...` 25 26 27 ## Memory requirements 28 To decode and display a GIF animation the following amount of RAM is required: 29 - `LV_COLOR_DEPTH 8`: 3 x image width x image height 30 - `LV_COLOR_DEPTH 16`: 4 x image width x image height 31 - `LV_COLOR_DEPTH 32`: 5 x image width x image height 32 33 ## Example 34 ```eval_rst 35 .. include:: ../../examples/libs/gif/index.rst 36 ``` 37 38 ## API 39 40 ```eval_rst 41 .. doxygenfile:: lv_gif.h 42 :project: lvgl 43 ```