在CLUE显示图像

Adafruit CircuitPython相关
MicroPython重要分支
回复
头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

在CLUE显示图像

#1

帖子 shaoziyang »

使用 adafruit_imageload 库(需要预先将adafruit_imageload库复制到CLUE中),就可以在clue上显示图像,参考代码如下:

代码: 全选

import displayio
import adafruit_imageload
from adafruit_clue import clue

bmp, pal = adafruit_imageload.load("g.bmp")
background = displayio.TileGrid(bmp, pixel_shader=pal)

splash = displayio.Group(max_size=5)
splash.append(background)

clue.display.show(splash)
注:
  • 图像大小不能超过240x240
  • 受芯片RAM限制,图像文件大小不能太大,最好小于30KB
  • 图像使用bmp格式,最好用16色和标准调色板,否则显示效果可能不好
 
 

头像
shaoziyang
帖子: 3917
注册时间: 2019年 10月 21日 13:48

Re: 在CLUE显示图像

#2

帖子 shaoziyang »

上面代码用的图像文件
g.zip
(4.04 KiB) 下载 125 次
 

回复

  • 随机主题
    回复总数
    阅读次数
    最新文章