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:
23
examples/widgets/animimg/lv_example_animimg.c
Normal file
23
examples/widgets/animimg/lv_example_animimg.c
Normal 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
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user