Extra: widgets: add a new widget animation image (#2167)

* Extra: widgets: add a new widget animation image

This widget is a combination of img and animation,
could achieve animation effects by
constantly switching a series imgs.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
Signed-off-by: Hui Song <hui.song_1@nxp.com>
Signed-off-by: Xiaolin He <xiaolin.he@nxp.com>

* example: add animimg example

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
This commit is contained in:
ZhaoQiang-b45475
2021-05-07 20:50:48 +08:00
committed by GitHub
parent 684db9b3e7
commit 8f083a34fa
14 changed files with 2477 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#include "../../lv_examples.h"
#if LV_USE_ANIMIMG && LV_BUILD_EXAMPLES
LV_IMG_DECLARE(anim001)
LV_IMG_DECLARE(anim002)
LV_IMG_DECLARE(anim003)
static const lv_img_dsc_t* anim_imgs[3] = {
&anim001,
&anim002,
&anim003,
};
void lv_example_animimg(void)
{
lv_obj_t * animimg0 = lv_animimg_create(lv_scr_act());
lv_obj_set_pos(animimg0, 189, 79);
lv_animimg_set_src(animimg0, (lv_img_dsc_t**) anim_imgs, 3);
lv_animimg_set_duration(animimg0, 1000);
lv_animimg_set_repeat_count(animimg0, 3000);
lv_animimg_start(animimg0);
}
#endif

View File

@@ -28,6 +28,8 @@ extern "C" {
void lv_example_arc_1(void);
void lv_example_arc_2(void);
void lv_example_animimg(void);
void lv_example_bar_1(void);
void lv_example_bar_2(void);
void lv_example_bar_3(void);