[IMAGE-SIG] Re: findphoto/cracker.c

Fredrik Lundh fredrik@pythonware.com
Fri, 12 Dec 1997 16:24:15 +0100


> Why I can not see the image under Windows NT 4.0? or
> I have to view the image in Tkinter?

There's some hackish code in 0.3 that displays the image
if 1) you've already initialized Tkinter (by creating a Tk
instance), and 2) you've entered the Tkinter mainloop.
I don't really like that solution, so I'm probably going to
remove it in the next release...

However, displaying an image under Tkinter is pretty straight-
forward (provided you have linked Tk with the PIL extensions):

    from Tkinter import *
    import Image, ImageTk

    root =3D Tk()

    photo =3D ImageTk.PhotoImage(Image.open("foo.ppm"))

    w =3D Label(root, image=3Dphoto)
    w.pack()

    mainloop()

You'll find more info on the ImageTk module at:
http://www.pythonware.com/library/pil/handbook/imagetk.htm

Also see the viewer.py and other sample scripts provided with
the distribution.

Cheers /F



_______________
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________