mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
8f083a34fa
* 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>
24 lines
556 B
C
24 lines
556 B
C
#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
|