【发布时间】:2019-03-30 13:26:58
【问题描述】:
屏幕:
首先,我的 Frame 的白色背景存在问题,因为它超出了 LabelFrame。其次,我希望图像位于框架的中间。
img = ImageTk.PhotoImage(Image.open(filename))
panel.image = img
panel.configure(image=img)
ImageFrame = LabelFrame(page1, text="Podgląd", height=200, width=300, background='white')
ImageFrame.grid(row=0, column=3, pady=10, padx=5)
panel = Label(ImageFrame)
panel.grid(row=0, column=0, sticky='NESW')
ImageFrame.grid_propagate(0)
【问题讨论】:
标签: python image user-interface tkinter frame