李昂 ebe596f051
add examples/lvgl/lv_png.py.
Signed-off-by: 李昂 <liang6516@outlook.com>
2023-06-29 00:40:35 +00:00

17 lines
272 B
Python

import lvgl as lv
f = open('/pikafs/1.png', 'rb')
img_data = f.read()
f.close()
img_dsc = lv.img_dsc_t({
"data_size": len(img_data),
"data": img_data,
})
img = lv.img(lv.scr_act())
img.set_zoom(500)
img.align(lv.ALIGN.CENTER, 0, -20)
img.set_src(img_dsc)