ich habe ein Prob. mit PhotoImage wenn ich das so:
Code: Alles auswählen
photo = Tkinter.PhotoImage(file="search.png")
Search = Button(image=photo, command = seachweb)
Search.photo = photo
Search.place(relx=0.235, rely=0.75, relwidth=0.14, relheight=0.2)
bekomme ich eine Fehlermeldung.
Die lautet so:
Code: Alles auswählen
Traceback (most recent call last):
File "J:\JT_proj\python\Webseach\pywwwseachdesk.py", line 79, in <module>
photo = Tkinter.PhotoImage(file="search.png")
File "C:\Python27\lib\lib-tk\Tkinter.py", line 3244, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 3200, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
TclError: couldn't recognize data in image file "search.png"jtschoch hat geschrieben: Ich weiß nicht ob,
dass an der Image liegt, weil die bloß 48x48 groß ist ist eigentlich ein Icon
aber ich habe es als PNG gemacht.


Das Bild hat ein leicht Tranzperenten Farbverlauf. Wie kann ich das ändern?