I am using Tkinter to write a GUI and want to display a png file in a Tkiner.Label
.
So I have some code like this:
self.vcode.img = PhotoImage(d
from tkinter import *
from tkinter import messagebox
import os
from PIL import Image, ImageTk
root = Tk()
root.geometry("1300x720")
root.title("KEDİLERİMİZ ve KÖPEKLERİMİZ")
class Ana:
def __init__(self,name,roll):
self.name = name
self.roll = roll
resim = Label(root,width=77,height=43,bg="blue")
resim.place(x=730,y=10)
o = "1.PNG"
hu = o.find(".")
mu = o[hu:]
if mu == ".gif" or mu == ".png":
img = PhotoImage(file = o)
else:
photo = Image.open(o)
img = ImageTk.PhotoImage(photo)
resim.configure(image=img,width=img.width(),height=img.height())
resim.image = img