lv_gif.h
API reference for lv_gif.h
Functions
lv_gif_set_color_format
Set the color format of the internally allocated framebuffer that the gif will be decoded to. The default is LV_COLOR_FORMAT_ARGB8888. Call this before lv_gif_set_src to avoid reallocating the framebuffer.
void lv_gif_set_color_format(lv_obj_t *obj, lv_color_format_t color_format)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif object |
color_format | lv_color_format_t | the color format of the gif framebuffer |
lv_gif_set_src
Set the gif data to display on the object
void lv_gif_set_src(lv_obj_t *obj, const void *src)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif object |
src | const void * | 1) pointer to an lv_image_dsc_t descriptor (which contains gif raw data) or 2) path to a gif file (e.g. "S:/dir/anim.gif") May be NULL. When NULL the current source is closed. |
lv_gif_set_loop_count
Set the loop count for the GIF.
void lv_gif_set_loop_count(lv_obj_t *obj, int32_t count)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif obj |
count | int32_t | the loop count to set |
lv_gif_set_auto_pause_invisible
Set whether to decode invisible object.
void lv_gif_set_auto_pause_invisible(lv_obj_t *obj, bool auto_pause)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif object |
auto_pause | bool | true: auto pause when invisible, false: don't auto pause |
lv_gif_get_loop_count
Get the loop count for the GIF.
int32_t lv_gif_get_loop_count(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif obj |
lv_gif_get_size
Get gif width & height
bool lv_gif_get_size(const char *src, uint16_t *w, uint16_t *h)| Name | Type | Description |
|---|---|---|
src | const char * | pointer to a gif file |
w | uint16_t * | pointer to store width |
h | uint16_t * | pointer to store height |
Returns: bool — true: success; false: failed
lv_gif_get_frame_count
Get frame count of the GIF.
int32_t lv_gif_get_frame_count(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif object |
Returns: int32_t — frame count of the GIF
lv_gif_get_current_frame_index
Get the current frame index of the GIF.
int32_t lv_gif_get_current_frame_index(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif object |
Returns: int32_t — current frame index of the GIF
lv_gif_create
Create a gif object
lv_obj_t * lv_gif_create(lv_obj_t *parent)| Name | Type | Description |
|---|---|---|
parent | lv_obj_t * | pointer to a parent widget May be NULL.. When NULL, the widget is created as a screen on the default display. |
Returns: lv_obj_t * — pointer to the gif obj
lv_gif_restart
Restart a gif animation.
void lv_gif_restart(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif obj |
lv_gif_pause
Pause a gif animation.
void lv_gif_pause(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif obj |
lv_gif_resume
Resume a gif animation.
void lv_gif_resume(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif obj |
lv_gif_is_loaded
Checks if the GIF was loaded correctly.
bool lv_gif_is_loaded(lv_obj_t *obj)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a gif obj |
Variables
lv_gif_class
const lv_obj_class_t lv_gif_classDependencies
Last updated on