Python Program to Display Images in Tkinter Frames

Python course with 57 real-time projects - Learn Python

Program 1

from tkinter import *
my_root=Tk()
my_root.geometry('700x700')
my_root.maxsize(500,500)
my_root.minsize(500,500)
my_root.title("My Image Page")
my_root.wm_iconbitmap('2.ico')
mf=Frame(my_root,width='700',height='700',bg='yellow',cursor='cross')
mf.propagate(0)
mf.pack()
#lb1=Label(mf,width=40,height=2,text="Enter Student ID:",bg='green',fg='#EE3B3B')
file1=PhotoImage(file='bird.gif')
lb1=Label(mf,width=400,height=400,image=file1)
lb1.pack()
my_root.mainloop()

 

Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google

follow dataflair on YouTube

Leave a Reply

Your email address will not be published. Required fields are marked *