0
How to place an image in the Tkinter library widget?
0
How to place an image in the Tkinter library widget?
2
The 'hello world' image on Tkinter is something like the following code:
import tkinter as tk
root = tk.Tk()
imagem = tk.PhotoImage(file="stack-overflow.png")
w = tk.Label(root, image=imagem)
w.imagem = imagem
w.pack()
root.mainloop()
Upshot:
P.S. A complete path to the image in Windows would look something like this:
imagem = tk.PhotoImage(file="c:/Users/Public/Pictures/stack-overflow.png")
But I can insert a photo from the pc gallery?
@Biancasan Yes, just put her full address.
thank you so much:-)
@Biancasan included at the end of the answer an example of full path to a file on the computer (need now switch to your case)
how I would adjust the image size ?
Browser other questions tagged python tkinter
You are not signed in. Login or sign up in order to post.
Do you have any code where you want to use the image to show?
– Daniel
in reality is the basis for Tkinter
– Bianca San