Animation Image (lv_animimg)

Overview

The animation image is similar to the normal 'Image' object. The only difference is that instead of one source image, you set an array of multiple source images.

You can specify a duration and repeat count.

Parts and Styles

  • LV_PART_MAIN A background rectangle that uses the typical background style properties and the image itself using the image style properties.

Usage

Image sources

To set the image in a state, use the lv_animimg_set_src(imgbtn, dsc[], num).

Events

No special events are sent by image objects.

See the events of the Base object too.

Learn more about Events.

Keys

No Keys are processed by the object type.

Learn more about Keys.

Example

API

Typedefs

typedef uint8_t lv_animimg_part_t

Enums

enum [anonymous]

Values:

enumerator LV_ANIM_IMG_PART_MAIN

Functions

lv_obj_t *lv_animimg_create(lv_obj_t *parent)

Create an animation image objects

Parameters

parent -- pointer to an object, it will be the parent of the new button

Returns

pointer to the created animation image object

void lv_animimg_set_src(lv_obj_t *img, lv_img_dsc_t *dsc[], uint8_t num)

Set the image animation images source.

Parameters
  • img -- pointer to an animation image object

  • dsc -- pointer to a series images

  • num -- images' number

void lv_animimg_start(lv_obj_t *obj)

Startup the image animation.

Parameters

obj -- pointer to an animation image object

void lv_animimg_set_duration(lv_obj_t *img, uint32_t duration)

Set the image animation duration time. unit:ms

Parameters

img -- pointer to an animation image object

void lv_animimg_set_repeat_count(lv_obj_t *img, uint16_t count)

Set the image animation reapeatly play times.

Parameters
  • img -- pointer to an animation image object

  • count -- the number of times to repeat the animation

Variables

const lv_obj_class_t lv_animimg_class
struct lv_animimg_t

Public Members

lv_img_t img
lv_anim_t anim
lv_img_dsc_t **dsc
int8_t pic_count