Salut à toi, élève de NSI, comment puis-je t'aider ?
from tkinter import *
from PIL import Image, ImageTk
def getData():
width, height = photo.size
for y in range(height):
ligne = []
for x in range(width):
ligne.append(pixels[x, y])
data.append(ligne)
def update():
width, height = photo.size
for y in range(height):
for x in range(width):
pixels[x, y] = data[y][x]
img.paste(photo)
data = []
fen = Tk()
fen.title('Images')
photo = Image.open('XXXXXX.XXX')
pixels = photo.load()
img = ImageTk.PhotoImage(photo)
can = Canvas(fen,height = img.height(), width = img.width())
can.create_image(0,0,anchor = NW,image = img)
can.pack()
fen.mainloop()
Vous devez proposer une interface à partir de ce code. Vous pouvez aussi vous aider ce ce que vous avez vu l'année dernière en IHM