mirror of
https://github.com/lvgl/lvgl.git
synced 2024-12-02 22:24:02 +08:00
feat(examples) adjust micropython examples to use lv_png (#3639)
This commit is contained in:
parent
125b72f010
commit
33d8ca779d
@ -1,12 +1,7 @@
|
||||
#!/opt/bin/lv_micropython -i
|
||||
import lvgl as lv
|
||||
import display_driver
|
||||
from imagetools import get_png_info, open_png
|
||||
from img_wink_png import img_wink_png_map
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
img_wink_png = lv.img_dsc_t(
|
||||
{
|
||||
|
@ -1,11 +1,5 @@
|
||||
import gc
|
||||
import lvgl as lv
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Measure memory usage
|
||||
gc.enable()
|
||||
|
@ -1,9 +1,3 @@
|
||||
from imagetools import get_png_info, open_png
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
with open('../assets/img_cogwheel_argb.png', 'rb') as f:
|
||||
|
@ -1,10 +1,3 @@
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
anim_imgs = [None]*3
|
||||
# Create an image from the png file
|
||||
try:
|
||||
|
@ -1,10 +1,3 @@
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
with open('../../assets/img_star.png','rb') as f:
|
||||
|
@ -1,10 +1,3 @@
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
with open('../../assets/img_caret_down.png','rb') as f:
|
||||
|
@ -2,12 +2,6 @@
|
||||
import usys as sys
|
||||
import lvgl as lv
|
||||
import display_driver
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
|
@ -2,12 +2,6 @@
|
||||
import usys as sys
|
||||
import lvgl as lv
|
||||
import display_driver
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
|
@ -2,12 +2,6 @@
|
||||
import usys as sys
|
||||
import lvgl as lv
|
||||
import display_driver
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
|
@ -1,14 +1,8 @@
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
def ofs_y_anim(img, v):
|
||||
img.set_offset_y(v)
|
||||
# print(img,v)
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
with open('../../assets/img_skew_strip.png','rb') as f:
|
||||
|
@ -1,10 +1,3 @@
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
with open('../../assets/imgbtn_left.png','rb') as f:
|
||||
|
@ -2,12 +2,6 @@
|
||||
import utime as time
|
||||
import lvgl as lv
|
||||
import display_driver
|
||||
from imagetools import get_png_info, open_png
|
||||
|
||||
# Register PNG image decoder
|
||||
decoder = lv.img.decoder_create()
|
||||
decoder.info_cb = get_png_info
|
||||
decoder.open_cb = open_png
|
||||
|
||||
# Create an image from the png file
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user