【发布时间】:2020-04-15 14:39:10
【问题描述】:
我正在尝试使用 Tkinter 和 Pillow 制作图像幻灯片应用程序。我希望图像全屏显示,所以目前我的代码如下所示(我认为这些都是重要的部分,如果您需要查看更多内容,请询问我):
canvas = Canvas(root, width=screenwidth, height=screenheight, bg=‘black’)#screenwidth and height previously assigned (checked to be correct) variables containing screen dimensions.
image = image.resize((resizew, resizeh) Image.ANTIALIAS)
imagesprite = canvas.create_image(midx, midy, image=photo) #had changed our resized image to a tkinter photo image previously, midx and midy are just half the screen dimensions.
问题: 无论我更改什么设置,窗口边缘总会出现某种形式的灰色条。我尝试过更改窗口大小、更改画布大小、使用 root.geometry 手动设置窗口几何形状均无济于事。但是,某些设置组合会导致条数减少;我在 1 和 3 之间看到过。附加了当前状态下的输出图片。 shell中没有错误,不是(当前)图像左侧有边框
【问题讨论】:
标签: python-3.x tkinter python-imaging-library tkinter-entry