1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-02-04 07:13:00 +08:00
lvgl/examples/widgets/image/lv_example_image_1.c

22 lines
638 B
C
Raw Normal View History

2021-04-08 13:07:48 +02:00
#include "../../lv_examples.h"
2023-12-13 21:23:08 +01:00
#if LV_USE_IMAGE && LV_BUILD_EXAMPLES
2021-02-08 09:53:03 +01:00
void lv_example_image_1(void)
2021-02-08 09:53:03 +01:00
{
LV_IMAGE_DECLARE(img_cogwheel_argb);
lv_obj_t * img1 = lv_image_create(lv_screen_active());
2023-11-18 15:41:46 +01:00
lv_image_set_src(img1, &img_cogwheel_argb);
lv_obj_align(img1, LV_ALIGN_CENTER, 0, 0);
lv_image_set_scale_x(img1, 512);
lv_image_set_scale_y(img1, 128);
lv_image_set_rotation(img1, 10);
2023-08-31 22:03:31 +02:00
lv_obj_t * img2 = lv_image_create(lv_screen_active());
lv_image_set_src(img2, LV_SYMBOL_OK "Accept");
2023-08-31 22:03:31 +02:00
lv_obj_align_to(img2, img1, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
lv_obj_set_style_bg_opa(img1, 100, 0);
2021-02-08 09:53:03 +01:00
}
#endif