Hinzufügen eines Hintergrundbilds in Python
Ich versuche, in Python einem Canvas ein Hintergrundbild hinzuzufügen. Bisher sieht der Code so aus:
from Tkinter import *
from PIL import ImageTk,Image
... other stuffs
root=Tk()
canvasWidth=600
canvasHeight=400
self.canvas=Canvas(root,width=canvasWidth,height=canvasHeight)
backgroundImage=root.PhotoImage("D:\Documents\Background.png")
backgroundLabel=root.Label(parent,image=backgroundImage)
backgroundLabel.place(x=0,y=0,relWidth=1,relHeight=1)
self.canvas.pack()
root.mainloop()
Es wird ein AttributeError: PhotoImage zurückgegeben