我try 将格式为.jpg的图片插入为PhotoImage
但每次我try 运行该程序时,都会出现以下错误:
无法识别图像文件中的数据
但这从来不会发生在.png图片上,这让我想知道.png是不是tkinter唯一可以接受的格式?
我try 将格式为.jpg的图片插入为PhotoImage
但每次我try 运行该程序时,都会出现以下错误:
无法识别图像文件中的数据
但这从来不会发生在.png图片上,这让我想知道.png是不是tkinter唯一可以接受的格式?
The docstring for PhotoImage
says:
class PhotoImage(Image):
"""Widget which can display images in PGM, PPM, GIF, PNG format."""
所以,不,PNG不是唯一可接受的格式.PGM、PPM、GIF和PNG是.JPEG并非如此.