1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
import time
from threading import Thread
from tkinter import *
import tkinter as tk
from PIL import Image, ImageTk
def charger_image(filename, resize=None):
img = Image.open(filename)
if resize is not None:
img = img.resize(resize, Image.ANTIALIAS)
photo = ImageTk.PhotoImage(img)
return photo
# Création de la fenêtre principale
root = tk.Tk()
root.title("Test")
root.geometry('480x200+1100+10')
photo = charger_image("picture/carius.png")
photo2 = charger_image("picture/busy.png")
photo3 = charger_image("picture/donate.png")
Can = tk.Canvas(root, width=480,height=120)
Can.place(x=0, y=0)
Can.create_image(0,0, anchor=NW, image=photo)
Can1 = tk.Canvas(root, width=480,height=59,bg='white')
Can1.place(x=0, y=121)
idimage = Can1.create_image(480, 59, anchor=SE, image=photo3)
tk.Button(root, text='Se connecter').place(x=10, y=140)
tk.Button(root, text='Lancer la récupération',command=lancer).place(x=100, y=140)
root.mainloop() |
Partager