我想移动并调整tkinter画布图像对象的大小 . 它可以很好地移动图像 . 但使用绑定或按钮调整图像大小是错误的 . 帮我 . 也许,我不知道bind和button的命令功能(参数) . 谁通过示例代码轻松解释我...我的英语很糟糕..
from tkinter import *
from PIL import Image, ImageTk
import os
import PIL.Image
def move_rectangular(event):
if event.keysym == 'Up':
canvas.move(object_1, 0, -3)
# canvas.move(object_2, 0, -3)
if event.keysym == 'Down':
canvas.move(object_1, 0, 3)
# canvas.move(object_2, 0, 3)
if event.keysym == 'Left':
canvas.move(object_1, -3, 0)
# canvas.move(object_2, -3, 0)
if event.keysym == 'Right':
canvas.move(object_1, 3, 0)
# canvas.move(object_2, 3, 0)
def size_change(event, obj, img):
if event.keysym == 'b':
width = img.width
height = img.height
w &#