I want to use a transparent image as a button in a tkinter program. I searched a lot, and I finally came to this:
def play():
Gun = PhotoImage(file='Gun.png')
GunButton = Button(win, image = Gun) #no command yet
GunButton.photo = Gun
GunButton.place(x=100,y=100)
It shows the button as well but the image is not transparent, it has gray background. I tried this too but nothing changed:
def play():
Gun = PhotoImage(file='Gun.png')
GunButton = Button(win)
GunButton.config(image=Gun)
GunButton.photo = Gun
GunButton.place(x=100,y=100)
I also tried this, but the image is blank I'm new to python I would be thankful if someone could help me