# Day 12
# _____ _ _ _ _ _ _ _
# \_ \_ __ ___ __ _ __ _ ___ ___ __ _(_) |_| |__ | |_| | _(_)_ __ | |_ ___ _ __
# / /\/ '_ ` _ \ / _` |/ _` |/ _ \/ __| \ \ /\ / / | __| '_ \ | __| |/ / | '_ \| __/ _ \ '__|
# /\/ /_ | | | | | | (_| | (_| | __/\__ \ \ V V /| | |_| | | | | |_| <| | | | | || __/ |
# \____/ |_| |_| |_|\__,_|\__, |\___||___/ \_/\_/ |_|\__|_| |_| \__|_|\_\_|_| |_|\__\___|_|
# |___/
# images need to be defined as PhotoImage
# from there, you can use the subsample method to shrink images and zoom to enlarge them
# .subsample(x, y) - where x is the degree the x axis is shrinking and same with y
from tkinter import *
# window
window = Tk()
window.resizable(True, True)
window.title("Gui! with images")
window.geometry("400x500+600+100")
# define pictures
img1 = PhotoImage(file="phodo/Sepia.png").subsample(2, 2)
img2 = PhotoImage(file="phodo/Wave.png").subsample(2, 2)
img3 = PhotoImage(file="phodo/Wreck.png").subsample(2, 2)
img4 = PhotoImage(file="phodo/Abstractionism.png").subsample(2, 2)
# header
header = Label(window,
text="image",
font=20,
foreground="red")
header.pack()
# image
image = Label(window, image=img1)
image.pack()
# buttons to change img
Image1 = Button(window, text="Show image 1", font=12, command = lambda :image.config(image = img1))
Image1.pack()
Image2 = Button(window, text="Show image 2", font=12, command = lambda :image.config(image = img2))
Image2.pack()
Image3 = Button(window, text="Show image 3", font=12, command = lambda :image.config(image = img3))
Image3.pack()
Image4 = Button(window, text="Show image 4", font=12, command = lambda :image.config(image = img4))
Image4.pack()
mainloop()