Seite 1 von 1

fotos in canvas

Verfasst: Dienstag 12. Dezember 2006, 19:36
von matze4
ich möchte fotos in canvas einfügen weiß aber leider nich wie das geht!!!!
kann mir da jemand helfen????

danke schon mal im voraus

Verfasst: Dienstag 12. Dezember 2006, 21:05
von Flano
Hallo matze4,
ich hoffe das hilft dir weiter:

Code: Alles auswählen

canvas = Canvas(root, width = 400, height = 400, bg = 'white')
canvas.pack() 

myPhoto = PhotoImage(file = 'myPicture.gif')
canvas.create_image(225, 210, anchor = CENTER, image = myPhoto)
mfg
Flano :)

Verfasst: Freitag 2. Februar 2007, 10:55
von skypa
wie stehts mit png bildern?

Verfasst: Samstag 10. Februar 2007, 18:51
von Redprince
Moinsen...
Effbot.org / TkinterBook hat geschrieben:If you need to work with other file formats, the Python Imaging Library (PIL) contains classes that lets you load images in over 30 formats, and convert them to Tkinter-compatible image objects:
Quelle: http://effbot.org/tkinterbook/photoimage.htm