Tkinter transparency on label
20,006
It's not that the Label
can't show a transparent image, it's rather label has its own background color which is not transparent or the same as its parent. One workaround would simply be using its parent's bg as its own bg:
topFrame['bg'] = topFrame.master['bg']
Author by
Chris
Updated on February 04, 2020Comments
-
Chris about 4 years
from tkinter import * master = Tk() master.resizable(False, False) master.geometry('430x480+50+50') master.title("Ping Check") master.config(bg="#222") layer = PhotoImage(file ="logo.gif") topFrame = Label(text="Ping Checker", image=layer, fg="#fff", font="Bahnschrift 14") topFrame.place(x=11,y=10)
I'm using the following code, which displays the image, however, the label seems to have a background, which I do not want.
and the file https://imgur.com/a/JR4Hc
-
Chris about 6 yearsWhat if I'm using an image for the background of the master
-
Nae about 6 years