2024-09-30 01:26:00 发布
网友
from tkinter import * from PIL import ImageTk, Image top = Tk() file ='flame2.jpg' filename = PhotoImage(file) panel=PanedWindow() panel = Label(top, image = filename) panel.pack(side = "bottom", fill = "both", expand= "yes") top.mainloop()
您应该使用PIL来读取这种复杂的图像格式,并将它们作为可理解的对象传递给tkinter:
from PIL import Image, ImageTk ... my_image = Image.open("flame2.jpg") filename= ImageTk.PhotoImage(my_image) ... panel = Label(top, image=filename)
您应该使用PIL来读取这种复杂的图像格式,并将它们作为可理解的对象传递给tkinter:
相关问题 更多 >
编程相关推荐