
How to Resize Image in Tkinter Python | Tkinter Python
*Video Link:-
https://youtu.be/GECXvh9FKJ4
*Details:- In this program, we are setting the size of the image same as the size of the label using PIL package.
*Coding:-
from PIL import Image
from PIL import ImageTk
photo=Image.open(’male.jpg’)
def fit(label, photo):
width=label.winfo_width()
height=label.winfo_height()
img=photo.resize((width,height), Image.ANTIALIAS)
img1=ImageTk.PhotoImage(img)
label.configure(image=img1)
label.image=img1
*Tags:-
#python #tkinter #label #image #widget #online #learning #tutorial #india #coding #programming #computercodingclass