feat(examples) adjust micropython examples to use lv_png (#3639)
This commit is contained in:
@@ -1,12 +1,7 @@
|
|||||||
#!/opt/bin/lv_micropython -i
|
#!/opt/bin/lv_micropython -i
|
||||||
import lvgl as lv
|
import lvgl as lv
|
||||||
import display_driver
|
import display_driver
|
||||||
from imagetools import get_png_info, open_png
|
|
||||||
from img_wink_png import img_wink_png_map
|
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(
|
img_wink_png = lv.img_dsc_t(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
import gc
|
import gc
|
||||||
import lvgl as lv
|
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
|
# Measure memory usage
|
||||||
gc.enable()
|
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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
with open('../assets/img_cogwheel_argb.png', 'rb') as f:
|
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
|
anim_imgs = [None]*3
|
||||||
# Create an image from the png file
|
# Create an image from the png file
|
||||||
try:
|
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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
with open('../../assets/img_star.png','rb') as f:
|
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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
with open('../../assets/img_caret_down.png','rb') as f:
|
with open('../../assets/img_caret_down.png','rb') as f:
|
||||||
|
|||||||
@@ -2,12 +2,6 @@
|
|||||||
import usys as sys
|
import usys as sys
|
||||||
import lvgl as lv
|
import lvgl as lv
|
||||||
import display_driver
|
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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -2,12 +2,6 @@
|
|||||||
import usys as sys
|
import usys as sys
|
||||||
import lvgl as lv
|
import lvgl as lv
|
||||||
import display_driver
|
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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -2,12 +2,6 @@
|
|||||||
import usys as sys
|
import usys as sys
|
||||||
import lvgl as lv
|
import lvgl as lv
|
||||||
import display_driver
|
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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,14 +1,8 @@
|
|||||||
from imagetools import get_png_info, open_png
|
|
||||||
|
|
||||||
def ofs_y_anim(img, v):
|
def ofs_y_anim(img, v):
|
||||||
img.set_offset_y(v)
|
img.set_offset_y(v)
|
||||||
# print(img,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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
with open('../../assets/img_skew_strip.png','rb') as f:
|
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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
with open('../../assets/imgbtn_left.png','rb') as f:
|
with open('../../assets/imgbtn_left.png','rb') as f:
|
||||||
|
|||||||
@@ -2,12 +2,6 @@
|
|||||||
import utime as time
|
import utime as time
|
||||||
import lvgl as lv
|
import lvgl as lv
|
||||||
import display_driver
|
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
|
# Create an image from the png file
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user