Bonjour,

Mon programme affiche entre autre des images à l'intérieur de boutons. Seulement, lorsque mon programme se lance il m'affiche dans les boutons "pyimages" suivit du numéro de l'image (voir ci dessous).

Nom : Capture.PNG
Affichages : 127
Taille : 252,1 Ko

voila comment j'affiche mes images:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
def bouttonMenu1():
 
 
    boutton1_1= tkinter.Button(racine, image=img1 )
    boutton1_1.place(x= 5, y = screen_y / 4 + 5, width= screen_x / 2 - 5, height= screen_y * 5/8 - 5 - (screen_y / 4 + 5))
 
 
    boutton1_2= tkinter.Button(racine, image=img2)
    boutton1_2.place(x= screen_x / 2 + 5, y= screen_y / 4 + 5, width= screen_x / 2 - 10, height= screen_y * 5/8 - 5 - (screen_y / 4 + 5))
 
    boutton1_3= tkinter.Button(racine, text=img3)
    boutton1_3.place(x= 5, y= screen_y *5 / 8, width= screen_x / 2 - 5, height= screen_y - (screen_y * 5/8 - 5 - (screen_y / 4 + 5))-(screen_y / 4 - 5)- (screen_y / 25))
 
    boutton1_4= tkinter.Button(racine, text=img4)
    boutton1_4.place(x= screen_x / 2 + 5, y= screen_y * 5 / 8, width= screen_x / 2 - 10, height= screen_y - (screen_y * 5/8 - 5 - (screen_y / 4 + 5))-(screen_y / 4 - 5)- (screen_y / 25))
Et voila comment, les images sont chargés:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 
img1=PhotoImage(file="1.png")
img2=PhotoImage(file="2.png")
img3=PhotoImage(file="3.png")
img4=PhotoImage(file="4.png")
Si quelqu'un peut m'aider, merci d'avance.