Одна из функций кнопок должна поворачивать
изображение,
а другая изменять (уменьшать/увеличивать) размер изображения.
Как это реализовать в tkinter ?
main.py:
from tkinter import *
import PIL, os
from PIL import ImageTk, Image
while True:
try:
distanation = input('input pic dist>>>')
if distanation == 'break':
os.abort()
pil_image = Image.open(distanation)
except:
print('cant find')
else:
input()
break
#window options
window = Tk()
window.title('picture viewer(v0.14alpha)')
window.geometry('800x600')
window['bg'] = 'grey44'
for i in range(3):
window.columnconfigure(i, weight=1, minsize=70)
window.rowconfigure(i, weight=1, minsize=70)
#img
pil_image = pil_image.resize((700, 500), Image.ANTIALIAS)
pil_image.resize((18, 18))
image = ImageTk.PhotoImage(pil_image)
image_sprite = Label(window, image=image)
image_sprite.grid(row=1, column=1, padx=8)
label_pic_name = Label(window, text=distanation, fg='#ccc', bg='#555', font='Arial 14')
label_pic_name.grid(row=2, column=1)
#bottons_top
frame_top = Frame(window, width=100, height=100)
frame_top.grid(row=0, column=1)
btn1 = Button(frame_top, text="1111",
background="#555",
foreground="#ccc",
activebackground='#557',
font="16",
relief = FLAT
)
btn1.grid(row=0, column=1)
btn2 = Button(frame_top, text="2222",
background="#555",
foreground="#ccc",
activebackground='#557',
font="16",
relief = FLAT
)
btn2.grid(row=0, column=2)
btn3 = Button(frame_top, text="3333",
background="#555",
foreground="#ccc",
activebackground='#557',
font="16",
relief = FLAT
)
btn3.grid(row=0, column=3)
btn4 = Button(frame_top, text="4444",
background="#555",
foreground="#ccc",
activebackground='#557',
font="16",
relief = FLAT
)
btn4.grid(row=0, column=4)
#bottons_side
frame_side = Frame(window)
frame_side.grid(row=1, column=0, padx=10)
btn11 = Button(frame_side, text="1111",
background="#555",
foreground="#ccc",
activebackground='#557',
font="16",
relief = FLAT
)
btn11.grid(row=1, column=0)
btn22 = Button(frame_side, text="2222",
background="#555",
foreground="#ccc",
activebackground='#557',
font="16",
relief = FLAT
)
btn22.grid(row=2, column=0)
btn33 = Button(frame_side, text="3333",
background="#555",
foreground="#ccc",
activebackground='#557',
font="16",
relief = FLAT
)
btn33.grid(row=3, column=0)
btn44 = Button(frame_side, text="4444",
background="#555",
foreground="#ccc",
activebackground='#557',
font="16",
relief = FLAT
)
btn44.grid(row=4, column=0)
#functions
#def fbtn1:
#def fbtn2:
#def fbtn3:
#def fbtn4:
#def fbtn11:
#def fbtn22:
#def fbtn33:
#def fbtn44:
window.mainloop()