标签周围的白色边框与图像?

时间:2015-05-26 11:43:06

标签: python image python-2.7 tkinter

我将一些图像放在tkinter小部件中,使用经典的:

logo=PhotoImage(file="C:\Users\name\Desktop\image.gif")
immglab1=Label(image=logo)
immglab1.image=logo
immglab1.pack(anchor=N)

enter image description here

问题在于,当我设置小部件背景颜色(#1A1A1A)与图像背景颜色相同时,image.gif周围出现了一个白框,我无法理解为什么。

一些建议?

1 个答案:

答案 0 :(得分:3)

白框是图像边框和/或高光环。您需要将borderwidthhighlightthickness属性设置为零:

immglab1=Label(image=logo, borderwidth=0, highlightthickness=0)
相关问题