|
|
@ -52,19 +52,6 @@ def select_image(root):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
messagebox.showerror("错误", "没有选择图片路径")
|
|
|
|
messagebox.showerror("错误", "没有选择图片路径")
|
|
|
|
|
|
|
|
|
|
|
|
def show_selected_image(root):
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
显示选择的图像
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
global img_label
|
|
|
|
|
|
|
|
img_label = tk.Label(root)
|
|
|
|
|
|
|
|
img_label.pack(side=tk.TOP, pady=10)
|
|
|
|
|
|
|
|
img = Image.open(img_path)
|
|
|
|
|
|
|
|
img.thumbnail((160, 160))
|
|
|
|
|
|
|
|
img_tk = ImageTk.PhotoImage(img)
|
|
|
|
|
|
|
|
img_label.configure(image=img_tk)
|
|
|
|
|
|
|
|
img_label.image = img_tk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def changeSize(event, img, LabelPic):
|
|
|
|
def changeSize(event, img, LabelPic):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
根据窗口尺寸调整图像大小并显示
|
|
|
|
根据窗口尺寸调整图像大小并显示
|
|
|
|