Newbie needs help with canvas.create_image !
Antti Isomursu
aisomurs at paju.oulu.fi
Sat Feb 12 12:15:26 EST 2005
Ok, this is my problem:
With code below I get a red box with given width and height. When I
use that create_image, nothing happens. I only see that same red box.
Why is that?
The loop.bmp is working fine when I use show() method.
win = Toplevel()
canvas = Canvas(win, width=100, height=100, background='red')
canvas.pack()
im = Image.open("loop.bmp")
photo = ImageTk.PhotoImage(im)
canvas.create_image(8, 8, anchor="nw", image=photo)
(Interestingly loop.bmp appears to the red box if I try to pack that
canvas.create_image ( canvas.create_image.pack()) and ofcourse I also
get an error message that It can't be done. But anyway the picture
appears ...weird)
More information about the Python-list
mailing list