0

我正試圖在畫布上放置圖像,但似乎無法顯示圖像。我能夠使用photoimage()顯示圖像,但它缺乏調整大小的能力。我錯過了什麼嗎?Python Image.open()未顯示圖像

from tkinter import * 
from PIL import Image, ImageTk 


canvas_width = 285 
canvas_height =420 

master = Tk() 

canvas = Canvas(master, width=canvas_width, height=canvas_height) 
canvas.pack() 

img = Image.open(r"C:\Users\kraak\Desktop\PyCharm Community Editionz 2017.1.2\2.png") 

img.show() 
mainloop() 

回答