Answers for "image in tkinter python"

5

how to add a image in tkinter

from tkinter import *
root=Tk()
img=PhotoImage(file='sunshine.jpg')
Label(root,image=img).pack()
root.mainloop()
Posted by: Guest on August-03-2020
1

show image in tkinter pillow

import tkinter as tk
from PIL import Image, ImageTk

root = tk.Tk()
img = Image.open("path//to//imgage.jpg")
img = img.resize((250, 250))
tkimage = ImageTk.PhotoImage(img)
tk.Label(root, image=tkimage).grid()
Posted by: Guest on October-02-2020

Python Answers by Framework

Browse Popular Code Answers by Language