This code will open a main window with an image, then another window with the same image. Is there any way to resize the image to be smaller? (go to # !>>> IMAGE 2 (2nd window))
Here is the code:
from tkinter import ttk
from tkinter import *
root = Tk()
root.title('4 Dry Out')
# IMAGE 1 (1st window)
img=PhotoImage(file='4 Dry Out Logo.png')
Label(root,image=img).pack()
# window format
root.geometry("275x75")
root['bg']='blue'
class MainWin:
# main window frame
def __init__(self, master):
mainFrame = Frame(master)
mainFrame.pack()
# main window title / button
self.titleLabel = Label(master, text="4 Dry Out e-Rental", bg="blue", fg="white", font=("Arial Black", 20))
self.titleLabel.pack()
self.Btn = Button(master, text="Water Damage Equipment", command=self.MenuWin, bg="navy", fg="white", font=("Roboto")).pack()
# button: new window
def MenuWin(self):
self.record = Menu()
self.record.win.mainloop()
class Menu:
# new window frame
def __init__(self):
self.win = Toplevel()
self.frameFit = Frame(self.win)
self.frameFit.pack()
self.frameFit['bg']='blue'
# !>>> IMAGE 2 (2nd window)
photo = PhotoImage(file='4 Dry Out Logo.png')
label = Label(self.win,image=photo)
label.image = photo # reference!
label.pack()
# portal title
self.TitleLabel = Label(self.frameFit, text="e-Rental Portal", bg="blue", fg="white", font=("Arial Black",15)).pack()
# start / end
winStart = MainWin(root)
root.mainloop()