[Image-SIG] all I get is a white surface

Aureli Soria Frisch Aureli.Soria_Frisch@ipk.fhg.de
Wed, 19 Sep 2001 13:57:50 +0200


Hi

I think you should declare a frame after the root:

>
>import Tkinter
>import Image
>import ImageTk
>
>root =3D Tkinter.Tk()

win =3D Frame(root)
win.pack()

>im =3D Image.open("c:/Temp/someimg.png")
>tkim =3D ImageTk.PhotoImage(im)

and thus change ">l =3D Tkinter.Label(root, image=3Dtkim" to:
I=3DTkinter.Label(win,image=3Dtkim)

>l.pack()
>root.mainloop()
>




>Btw. what is a good way to convert a string with raw image data (grayscale)
>to a viewable PhotoImage. I tried using
>im.put(map(lambda v: "%02x", ord(v), data)), I gave up waiting after 10 min=
=2E

im.fromstring(data), where data is an string.

Regards,
Aureli

#################################
Aureli Soria Frisch
=46raunhofer IPK
Dept. Pattern Recognition

post: Pascalstr. 8-9, 10587 Berlin, Germany
e-mail:aureli@ipk.fhg.de
fon: +49 30 39006-150
fax: +49 30 3917517
web: http://vision.fhg.de/~aureli/web-aureli_en.html
#################################