因为这两个
zoom()和
subsample()希望整数作为参数,我用这两种。
我不得不将320x320图片的尺寸调整为250x250,最终
imgpath = '/path/to/img.png'img = PhotoImage(file=imgpath)img = img.zoom(25) #with 250, I ended up running out of memoryimg = img.subsample(32) #mechanically, here it is adjusted to 32 instead of 320panel = Label(root, image = img)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)