python - tkinter.TclError:图像“pyimage45”不存在
问题描述
我正在尝试将yt.py
具有图像标签和按钮的 python 模块导入到fpassm.py
单击时具有图像按钮的 python 文件,但它给了我一个错误
_tkinter.TclError: image "pyimage45" doesn't exist
。
ytphoto=PhotoImage(file='youtube.png')
yt=Button(root,image=ytphoto,borderwidth=0, activebackground='#ffffff', command = youtube)
ytsize=ytphoto.subsample(1,1)
yt.config(image=ytsize,bg='#fdffff')
yt.place(x = 300,y = 100)
解决方案
推荐阅读
- oracle - 提供对 Oracle 中特定视图的只读访问权限
- android - SKSharp 未加载位图 Xamarin 表单
- php - 如何在php中获取输入类型imagein的id
- sharepoint - 上传后 C# SharePoint CSOM 更改文件属性
- apache-spark - 控制在 spark 中处理分区的顺序
- javascript - CropBox 唯一编号作为订单参考 PHP
- javascript - Javascript 获取用户位置(国家、语言、时区)
- forms - 是的验证:需要语言的所有或没有字段
- python - 使用 Python 在两个 PN532 之间进行 NFC 点对点
- json - OPENJSON 从表中解析 3M 行很慢