Tkinter 全屏留下边框

Tkinter fullscreen leaves border

我正在尝试使用 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.  

问题: 无论我更改什么设置,window 的边缘总会出现某种形式的灰色条。我尝试过更改 window 大小、更改 canvas 大小、使用 root.geometry 手动设置 window 几何图形,但均无济于事。但是,某些设置组合会导致条数减少;我在 1 和 3 之间看到过。附上了当前状态下的输出图片。 shell没有错误,不是(目前)图片左边有边框

[1]: https://i.stack.imgur.com/1DLfg.jpg

创建canvas时需要设置highlightthickness=0:

canvas = Canvas(root, width=screenwidth, height=screenheight, bg='black', highlightthickness=0)