You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Change back to PNGs
There is no real performance hit, and they are easier for developers.
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 9.0 KiB |
@@ -29,16 +29,8 @@ start = time.ticks_ms()
|
||||
|
||||
def load_icon(icon_path):
|
||||
with open(icon_path, 'rb') as f:
|
||||
f.seek(12) # first 12 bytes are headers
|
||||
image_data = f.read()
|
||||
image_dsc = lv.image_dsc_t({
|
||||
"header": {
|
||||
"magic": lv.IMAGE_HEADER_MAGIC,
|
||||
"w": 64,
|
||||
"h": 64,
|
||||
"stride": 64 * 2,
|
||||
"cf": lv.COLOR_FORMAT.RGB565A8
|
||||
},
|
||||
'data_size': len(image_data),
|
||||
'data': image_data
|
||||
})
|
||||
@@ -79,13 +71,13 @@ for app_dir_fullpath in app_dirs:
|
||||
app_cont.set_style_border_width(0, 0)
|
||||
app_cont.set_style_pad_all(0, 0)
|
||||
# Load and display icon
|
||||
icon_path = f"{app_dir_fullpath}/res/mipmap-mdpi/icon_64x64.bin"
|
||||
icon_path = f"{app_dir_fullpath}/res/mipmap-mdpi/icon_64x64.png"
|
||||
image = lv.image(app_cont)
|
||||
try:
|
||||
image.set_src(load_icon(icon_path))
|
||||
except Exception as e:
|
||||
print(f"Error loading icon {icon_path}: {e} - loading default icon")
|
||||
icon_path = "/builtin/res/mipmap-mdpi/default_icon_64x64.bin"
|
||||
icon_path = "/builtin/res/mipmap-mdpi/default_icon_64x64.png"
|
||||
try:
|
||||
image.set_src(load_icon(icon_path))
|
||||
except Exception as e:
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
Reference in New Issue
Block a user