0

I want to display the image which is searched by the button but it doesn't work... I have no idea about how I can do this so I ask to you guys !

# -*-coding:Utf-8 -*
from tkinter import *
from tkinter.filedialog import * 
from PIL import Image as Img
from PIL import ImageTk



class Imageblank:

def chercherFichier(Imageblank):
    Imageblank.Image = askopenfilename(title="Ouvrir une image",filetypes=[('png files','.png'),])
    Imageblank.presentation = Img.open(Imageblank.Image)
    Imageblank.presentationTk = ImageTk.PhotoImage(Imageblank.presentation)




fen_princ = Tk()    
fen_princ.title("Création de l'image encodée")
fen_princ.geometry('500x250')

Label(fen_princ, text="CREATION DE L'IMAGE CODEE" ,font=("Helvetica", 15)).pack() 

imagefile= Imageblank()

Label(fen_princ, text="Fichier image de base :" ,font=("Helvetica", 10), anchor=W).pack() 

Button(fen_princ, text="Chercher l'image de base dans les répertoires", command=imagefile.chercherFichier).pack() 

0 Answers0