photoimage

Python Tkinter Treeview add an image as a column value

我是研究僧i 提交于 2020-03-20 20:45:21
问题 i'm trying to add an Image to the first column of every row on a treeview, but no matter what I do, always end up with the name of the object "pyimage1" showed instead of the actual image. As this image shows The code that i'm using is something like this. from tkinter import PhotoImage. self._img = PhotoImage(file="resources\information_picto.gif") self.tree.insert('', 'end', values= self._image,self.name, self.status, self.cores, self.turn, self.added_time) I've tried with png, with the

Tkinter: Couldn't recognize data in image file

自古美人都是妖i 提交于 2019-12-20 06:56:28
问题 I have the following problem. I generate .GIF files using an external application. To me the GIFs look fine, I can open them without problems. However, using photo = PhotoImage(file=screenshot_file) self.previewImageLabel.config(image=photo) self.previewImageLabel.image = photo to add an image to a Tkinter Label, is giving me the following error: TclError: couldn't recognize data in image file "C:\Users\D8W\Python\hoang\combi ne_model_neu\test_bauteile\SQTR-VO\prev_F45_SQTR.GIF" The thing is,

Tkinter: Couldn't recognize data in image file

坚强是说给别人听的谎言 提交于 2019-12-20 06:56:27
问题 I have the following problem. I generate .GIF files using an external application. To me the GIFs look fine, I can open them without problems. However, using photo = PhotoImage(file=screenshot_file) self.previewImageLabel.config(image=photo) self.previewImageLabel.image = photo to add an image to a Tkinter Label, is giving me the following error: TclError: couldn't recognize data in image file "C:\Users\D8W\Python\hoang\combi ne_model_neu\test_bauteile\SQTR-VO\prev_F45_SQTR.GIF" The thing is,

py2exe gives RuntimeError: Too early to create image

做~自己de王妃 提交于 2019-12-11 06:49:31
问题 This python27 32bit code runs perfectly in IDLE, but when packaged by py2exe... not so good. This is not a duplicate of the missing Tk() question. Something else appears to be uninitialized when running the py2exe generated executable, the call at ImageTk.PhotoImage() balks with 'too early to create image': C:\python\python_ui\exe\dist>basic.exe Traceback (most recent call last): File "basic.py", line 7, in <module> File "PIL\ImageTk.pyo", line 117, in __init__ File "Tkinter.pyo", line 3367,

Tkinter: Couldn't recognize data in image file

泪湿孤枕 提交于 2019-12-02 11:31:28
I have the following problem. I generate .GIF files using an external application. To me the GIFs look fine, I can open them without problems. However, using photo = PhotoImage(file=screenshot_file) self.previewImageLabel.config(image=photo) self.previewImageLabel.image = photo to add an image to a Tkinter Label, is giving me the following error: TclError: couldn't recognize data in image file "C:\Users\D8W\Python\hoang\combi ne_model_neu\test_bauteile\SQTR-VO\prev_F45_SQTR.GIF" The thing is, when I upload one of the GIFs to some online Converter and convert them to "GIF", they get displayed

cannot associate image to tkinter label

旧巷老猫 提交于 2019-11-28 13:09:14
I am trying to display an image to a tkinter GUI using tkinter.Label() widget. The procedure seems simple and straightforward, but this code doesn't work! code: import Tkinter as tk import Image, ImageTk, sys filename = 'AP_icon.gif' im = Image.open(filename) # Image is loaded, because the im.show() works tkim = ImageTk.PhotoImage(im) root = tk.Tk() label = tk.Label(root, image = tkim) # Here is the core problem (see text for explanation) label.image = tkim # This is where we should keep the reference, right? label.grid (row = 0, column = 0) tk.Button(root, text = 'quit', command = lambda: sys

cannot associate image to tkinter label

血红的双手。 提交于 2019-11-26 23:35:20
问题 I am trying to display an image to a tkinter GUI using tkinter.Label() widget. The procedure seems simple and straightforward, but this code doesn't work! code: import Tkinter as tk import Image, ImageTk, sys filename = 'AP_icon.gif' im = Image.open(filename) # Image is loaded, because the im.show() works tkim = ImageTk.PhotoImage(im) root = tk.Tk() label = tk.Label(root, image = tkim) # Here is the core problem (see text for explanation) label.image = tkim # This is where we should keep the