Monday, 19 August 2013

Cannot resize Image with tkinter

Cannot resize Image with tkinter

I am trying to create a tkinter project in python 2.7, where the user can
resize the window, and everything inside the window will scale with it.
This means the canvas, the shapes in the canvas and most importantly the
PhotoImages will scale with the window. My problem, is for the life of me
I cannot get my images to resize properly. I know that subsample and zoom
exist for this purpose, but first of all
plantImage = PhotoImage(file="images/Arable_Cell.gif")
plantImage.subsample(2, 2)
canvas.create_image(0, 0, anchor=NW, image=plantImage)
Makes no noticeable change in a 50x50 pixel image and same for zoom(2, 2).
It is important to note I know PIL exists but for the purposes of this
project I cannot download any extra libraries. So what am I doing wrong?

No comments:

Post a Comment