我找不到任何方法将.bmp文件加载到Tkinter()中,以便在画布小部件中使用它!请帮帮我!
from Tkinter import *
from PIL import Image
import ImageTk
import tkFileDialog
import tkMessageBox
root=Tk()
class lapp:
def __init__(self,master):
w=Canvas(root,width=300,height=300)
w.pack()
p=Image.open("001.bmp")
tkimage=ImageTk.PhotoImage(p)
w.creat_image(0,0,image=tkimage)
App=lapp(root)
root.mainloop()
Its not showing any image on the canvas, its just blank! Btw I m using win7 with python 2.7