您必须保留对PhotoImage的引用。这只是一个示例(您也可以使用
self.background代替
c.background):
c = Canvas(frame2) c.pack(expand=YES,fill=BOTH) c.background = PhotoImage(file='Board.gif') c.create_image(100,100,image=c.background,anchor='nw')

您必须保留对PhotoImage的引用。这只是一个示例(您也可以使用
self.background代替
c.background):
c = Canvas(frame2) c.pack(expand=YES,fill=BOTH) c.background = PhotoImage(file='Board.gif') c.create_image(100,100,image=c.background,anchor='nw')