有没有办法使用Tkinter使标签背景不可见/透明?

时间:2016-12-28 10:21:43

标签: python tkinter label invisible

我使用Tkinter(ttk)写了一个简单的GUI程序:

在窗口的中央,有一个带图像的标签。 图像自我是透明的GIF。但如果图像具有alpha背景,则可以看到图像并查看标签的背景颜色。

View example

有没有办法让标签上的图像可见而不是标签(-background)本身?

如果我以常用方式尝试,整个标签就会消失。我不会将背景颜色设置为'White',因为在其他情况下,当背景颜色为多种颜色时,我需要此方法。

//编辑:这个doesen工作:

labelSpeichern=ttk.Label(root, image=predef.speicherngif, background="Transparent")
labelSpeichern.place(x= 250, y=300, width= 200, height=40)

0 个答案:

没有答案
相关问题