1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| class Agrandir(object) :
def __init__(self, can2, image, image2, i) :
self.can2 = can2
self.image = image
self.image2 = image2
self.i = i
def agrandir(self) :
self.size = 256, 256
self.image.thumbnail(self.size)
self.photo = PIL.ImageTk.PhotoImage(self.image)
self.mini_photo = Button(self.can2, height=260, width=200, bg='white', bd=0, image=self.photo, activebackground='green', cursor='hand2', command=self.photo_agrandie)
self.mini_photo.grid(row=1, column = self.i, padx=10, sticky='n')
def photo_agrandie(self) :
self.grande_photo = Toplevel(height=600, width = 600)
self.size2 = 512, 512
self.image2.thumbnail(self.size2)
self.photo2 = PIL.ImageTk.PhotoImage(self.image2)
self.can3 = Canvas(self.grande_photo, height = 510, width = 375, bg = 'blue')
self.can3.grid()
self.can3.create_image(1,1, anchor = 'nw', image = self.photo2) |
Partager