Resizing pictures in PIL in Tkinter

前端 未结 3 919
南旧
南旧 2020-12-03 03:29

I\'m currently using PIL to display images in Tkinter. I\'d like to temporarily resize these images so that they can be viewed more easily. How can I go about this?

3条回答
  •  孤城傲影
    2020-12-03 04:19

    the easiest might be to create a new image based on the original, then swap out the original with the larger copy. For that, a tk image has a copy method which lets you zoom or subsample the original image when making the copy. Unfortunately it only lets you zoom/subsample in factors of 2.

提交回复
热议问题