initial commit
This commit is contained in:
BIN
libraries/lvgl/examples/libs/bmp/example_16bit.bmp
Normal file
BIN
libraries/lvgl/examples/libs/bmp/example_16bit.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
libraries/lvgl/examples/libs/bmp/example_24bit.bmp
Normal file
BIN
libraries/lvgl/examples/libs/bmp/example_24bit.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
libraries/lvgl/examples/libs/bmp/example_32bit.bmp
Normal file
BIN
libraries/lvgl/examples/libs/bmp/example_32bit.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
6
libraries/lvgl/examples/libs/bmp/index.rst
Normal file
6
libraries/lvgl/examples/libs/bmp/index.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
Open a BMP image from file
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. lv_example:: libs/bmp/lv_example_bmp_1
|
||||
:language: c
|
||||
|
||||
38
libraries/lvgl/examples/libs/bmp/lv_example_bmp.h
Normal file
38
libraries/lvgl/examples/libs/bmp/lv_example_bmp.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file lv_example_bmp.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_EXAMPLE_BMP_H
|
||||
#define LV_EXAMPLE_BMP_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_example_bmp_1(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_EXAMPLE_BMP_H*/
|
||||
21
libraries/lvgl/examples/libs/bmp/lv_example_bmp_1.c
Normal file
21
libraries/lvgl/examples/libs/bmp/lv_example_bmp_1.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_BMP && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Open a BMP file from a file
|
||||
*/
|
||||
void lv_example_bmp_1(void)
|
||||
{
|
||||
lv_obj_t * img = lv_img_create(lv_scr_act());
|
||||
/* Assuming a File system is attached to letter 'A'
|
||||
* E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */
|
||||
#if LV_COLOR_DEPTH == 32
|
||||
lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_32bit.bmp");
|
||||
#elif LV_COLOR_DEPTH == 16
|
||||
lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_16bit.bmp");
|
||||
#endif
|
||||
lv_obj_center(img);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
13
libraries/lvgl/examples/libs/bmp/lv_example_bmp_1.py
Executable file
13
libraries/lvgl/examples/libs/bmp/lv_example_bmp_1.py
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/opt/bin/lv_micropython -i
|
||||
import lvgl as lv
|
||||
import display_driver
|
||||
import fs_driver
|
||||
|
||||
fs_drv = lv.fs_drv_t()
|
||||
fs_driver.fs_register(fs_drv, 'S')
|
||||
|
||||
img = lv.img(lv.scr_act())
|
||||
# The File system is attached to letter 'S'
|
||||
|
||||
img.set_src("S:example_32bit.bmp")
|
||||
img.center()
|
||||
Reference in New Issue
Block a user