initial commit
This commit is contained in:
6
libraries/lvgl/examples/libs/sjpg/index.rst
Normal file
6
libraries/lvgl/examples/libs/sjpg/index.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
Load an SJPG image
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. lv_example:: libs/sjpg/lv_example_sjpg_1
|
||||
:language: c
|
||||
|
||||
38
libraries/lvgl/examples/libs/sjpg/lv_example_sjpg.h
Normal file
38
libraries/lvgl/examples/libs/sjpg/lv_example_sjpg.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file lv_example_sjpg.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_EXAMPLE_SJPG_H
|
||||
#define LV_EXAMPLE_SJPG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_example_sjpg_1(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_EXAMPLE_SJPG_H*/
|
||||
17
libraries/lvgl/examples/libs/sjpg/lv_example_sjpg_1.c
Normal file
17
libraries/lvgl/examples/libs/sjpg/lv_example_sjpg_1.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_SJPG && LV_BUILD_EXAMPLES
|
||||
|
||||
/**
|
||||
* Load an SJPG image
|
||||
*/
|
||||
void lv_example_sjpg_1(void)
|
||||
{
|
||||
lv_obj_t * wp;
|
||||
|
||||
wp = 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 */
|
||||
lv_img_set_src(wp, "A:lvgl/examples/libs/sjpg/small_image.sjpg");
|
||||
}
|
||||
|
||||
#endif
|
||||
13
libraries/lvgl/examples/libs/sjpg/lv_example_sjpg_1.py
Executable file
13
libraries/lvgl/examples/libs/sjpg/lv_example_sjpg_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')
|
||||
|
||||
wp = lv.img(lv.scr_act())
|
||||
# The File system is attached to letter 'S'
|
||||
|
||||
wp.set_src("S:small_image.sjpg")
|
||||
wp.center()
|
||||
BIN
libraries/lvgl/examples/libs/sjpg/small_image.sjpg
Normal file
BIN
libraries/lvgl/examples/libs/sjpg/small_image.sjpg
Normal file
Binary file not shown.
Reference in New Issue
Block a user