Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- import tkinter as tk
- from PIL import Image, ImageTk
- root = tk.Tk()
- # Criar um objeto com o caminho da imagem
- image = Image.open("<path/image_name>")
- test = ImageTk.PhotoImage(image)
- label_image = tk.Label(image=test)
- label_image.image = test
- # Posição da imagem (Coordenadas <X e Y> na Window)
- label_image.place(x = '10', y = '10')
- # Factory Window
- root.title('Tkinter Image')
- root.resizable(False, False)
- root.config(background = 'white')
- root.geometry('250x250')
- root.eval('tk::PlaceWindow . center')
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement