如何从点阵显示中画出大写字母?

2024-04-20 07:10:51 发布

您现在位置:Python中文网/ 问答频道 /正文

如何使用pythontkinter以大写模式绘制所有字母表? 使用画布多边形有帮助吗?类似于A的内容:

w = Canvas(master, width=canvas_width, height=canvas_height).pack()
points = [100,0, 0, 100, 200,100]
w.create_polygon(points, outline=python_green, fill='yellow', width=3)

如何用pythontkinter或其他库创建一个简单的led点阵显示屏?在


Tags: master内容画布模式绘制多边形widthpack
1条回答
网友
1楼 · 发布于 2024-04-20 07:10:51

对于大写字母,您可以使用非常大的字体来书写大写字母(我不明白您为什么要画它们):

from tkinter import Tk, Canvas

master = Tk()
canvas = Canvas(master, bg="white", width=200, height=200)
canvas.pack()
canvas.create_text(50,50, text="A", fill="red", font="Arial 100")

master.mainloop()

对于led点阵显示屏,您可以执行以下操作:

^{pr2}$

enter image description here

相关问题 更多 >