如果我将字体族更改为fixedsys,白色边框确实会消失,但为什么
这是我的密码
import tkinter as tk
win = tk.Tk()
win.wm_attributes("-transparentcolor", "white")
win.configure(background='white')
label = tk.Label(text='Hello World', bg='white', font=('Microsoft YaHei', 30))
label.pack()
win.mainloop()
Tags:
tkinker(和PIL)字体引擎对背景颜色进行抗锯齿处理,在您的案例中为“白色”。你在chars周围看到的不是真正的白色而是灰色。要最小化效果,应在前景附近选择背景色,例如,如果前景为“黑色”,则选择“灰色1”,然后使“灰色1”透明。当然你失去了抗锯齿效果,但是白色消失了。试试这个:
相关问题 更多 >
编程相关推荐