在PhotoImage下调整图像大小

在PhotoImage下调整图像大小,第1张

在PhotoImage下调整图像大小

因为这两个

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)


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5652888.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存