Images (.bmp,.jpg,gif) in Tkinter windows (Tk newbie)

Tim Ottinger timo at iol32.com
Tue Apr 4 00:55:31 CEST 2000


On Mon, 27 Mar 2000 18:16:17 GMT, effbot at pythonware.com wrote:

>Tim Ottinger wrote:
>> I'm in Win32. I need an example (that works) of loading a graphical
>> image using Tkinter and python. Looking at the image and bitmap
>> options hasn't helped me, because I'm reading win32 .bmp files, not
>> xbm files. I'd like to read and display gifs, jpgs, and the like as
>> part of my Tkinter dialogs.
>
>native Tkinter supports GIF and PPM files (use the PhotoImage
>class to load them).
>
>   image = PhotoImage(file="myfile.gif")
>   widget.config(image=image)
>   widget.image = image # make sure to hang on to the image

Well, that would be okay, except that it doesn't actually display the
image on the screen (for me). Neither in '98 (boo) or 'NT (boo).

Tim



More information about the Python-list mailing list