【问题标题】:Make image full screen with PhotoImage使用 PhotoImage 使图像全屏显示
【发布时间】:2017-03-23 21:06:53
【问题描述】:

我试过了,但没有用:Image resize under PhotoImage

我已经有了这个:

import tkinter
root = tkinter.Tk()
root.attributes("-fullscreen", True)
photo = tkinter.PhotoImage(file="image.gif")
img1 = tkinter.Label(root, image = photo)
img1.pack()
root.mainloop()

这可行,但我的图像没有占据全屏,我想知道如何将其调整为全屏。

【问题讨论】:

  • 您是否尝试过链接到的问题中的内容(调用zoom 方法)?如果不是,为什么不呢?如果是这样,请展示您尝试过的内容。但是,如果您不知道,图像不会平滑地调整大小——您可以将大小增加一倍或三倍,但您将无法使其完全适合屏幕尺寸,除非大小已经是屏幕。
  • @BryanOakley 谢谢。你认为我应该使用 PIL

标签: python tkinter photoimage


【解决方案1】:

我意识到这是不可能的,我会尝试使用 PIL。感谢 @BryanOakley 帮助我解决这个问题。

【讨论】:

    猜你喜欢
    • 2014-07-22
    • 1970-01-01
    • 2019-06-30
    • 1970-01-01
    • 2021-12-15
    • 1970-01-01
    • 2010-12-16
    • 1970-01-01
    相关资源
    最近更新 更多