This commit is contained in:
jeremygan2021
2026-03-03 21:27:07 +08:00
parent 2470013ef3
commit c87d5deedf
7 changed files with 460 additions and 31 deletions

View File

@@ -83,3 +83,13 @@ class Display:
self.tft.fill_rect(100, 240 - bar_height, 40, bar_height - last_bar_height, color)
return bar_height
def show_image(self, x, y, width, height, rgb565_data):
"""在指定位置显示RGB565格式的图片数据"""
if not self.tft: return
try:
# 将字节数据转换为适合blit_buffer的格式
self.tft.blit_buffer(rgb565_data, x, y, width, height)
except Exception as e:
print(f"Show image error: {e}")