1 #include "../../lv_examples.h"
2 #if LV_BUILD_EXAMPLES
3 
4 #if LV_USE_LIBPNG
5 
6 /**
7  * Open a PNG image from a file
8  */
lv_example_libpng_1(void)9 void lv_example_libpng_1(void)
10 {
11     LV_IMAGE_DECLARE(img_png_demo);
12     lv_obj_t * img;
13 
14     img = lv_image_create(lv_screen_active());
15     lv_image_set_src(img, &img_png_demo);
16     lv_obj_align(img, LV_ALIGN_LEFT_MID, 10, 0);
17 
18     img = lv_image_create(lv_screen_active());
19     /* Assuming a File system is attached to letter 'A'
20      * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
21     lv_image_set_src(img, "A:lvgl/examples/libs/libpng/png_demo.png");
22     lv_obj_align(img, LV_ALIGN_RIGHT_MID, -10, 0);
23 }
24 
25 #else
26 
lv_example_libpng_1(void)27 void lv_example_libpng_1(void)
28 {
29     lv_obj_t * label = lv_label_create(lv_screen_active());
30     lv_label_set_text(label, "LibPNG is not installed");
31     lv_obj_center(label);
32 }
33 
34 #endif
35 
36 #endif
37