couldn't recognize data in image file---学习tkinter的PhotoImage的一个问题
来源:互联网 发布:网络端口是什么 编辑:程序博客网 时间:2024/05/06 18:02
from tkinter import *import syswin = Tk()fname = sys.path[0] + '\\1.gif'img = PhotoImage(file = fname)btn=Button(win, image = img)btn .pack()win.mainloop()
在学PhotoImage时,这段代码总是过不去。
原来我的1.gif并不是gif格式,仅仅是被改了后缀名的,原本是jpg格式。所以不支持
将其用画图工具打开,另存为gif格式就可以了。。
当问题的原因展现在我的面前时,突然间一丝热翔从我的眼角滑过。。。
我就去了,几年计算机都学到狗身上去了。我竟然会异想天开的通过该后缀名来改文件格式!!!!
- couldn't recognize data in image file---学习tkinter的PhotoImage的一个问题
- Tkinter中使用PhotoImage实例化图片报错的问题
- python Tkinter 的image问题
- python Tkinter PhotoImage "too early to create image"
- Tkinter控件使用image的问题
- 关于Eclipse导入Android工程出现couldn't write file:*********/.classpath的问题
- Couldn't resolve error 的问题
- iOS国际化时遇到的错误:read failed: the data couldn't be read because it isn't in the correct format.
- iOS国际化时遇到的异常:read failed: the data couldn't be read because it isn't in the correct format
- Tkinter PhotoImage 踩坑记录
- Couldn't connect to session bus问题的解决
- Couldn't resolve resource @id/pass问题的解决
- vbox虚拟机的couldn't resolve host问题
- Android Studio常见couldn't find "*.so"的问题
- Git出现Couldn't save uncommitted changes.问题的解决
- Couldn't create directory for SharedPreferences file /data/data/XXXX/xxx.xml错误处理
- Read data:the file "Info.plist" couldn't be opened because there is no such file
- 编译时,遇到Couldn't build player because of unsupported data on target platform的解决方案
- C笔试三
- WINCE 实用技巧 之 创建快捷方式详解
- 在WinCE中实现Screen Rotation(屏幕旋转)
- java泛型中的上界与下界
- 菜单样式特效
- couldn't recognize data in image file---学习tkinter的PhotoImage的一个问题
- IOCP模型和其它模型(如select模型)的区别
- c经典面试试题<一>
- select, iocp, epoll,kqueue及各种I/O复用机制
- 层的无间断滚动效果
- 设计模式之六大设计原则
- c/C++的xml解析
- "mkimage" command not found
- Apache集群