fotos in canvas

Fragen zu Tkinter.
Antworten
matze4
User
Beiträge: 2
Registriert: Dienstag 12. Dezember 2006, 19:29

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
Flano
User
Beiträge: 43
Registriert: Sonntag 5. September 2004, 14:13

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 :)
skypa
User
Beiträge: 97
Registriert: Freitag 5. Januar 2007, 03:13

wie stehts mit png bildern?
Redprince
User
Beiträge: 128
Registriert: Freitag 22. Oktober 2004, 09:22
Wohnort: Salzgitter
Kontaktdaten:

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
Antworten