Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+4 votes

Hi! I am putting images into my nifty project using Image(anchorPoint, filename). The problem I am finding is that the image takes up the whole screen when I don't want it to. Does anyone know how to make the image smaller?

asked in CSC201 Spring 2021 by (8 points)

I tried using .setShapeSize, but it seems like that only works for shapes not images unfortunately.

1 Answer

+1 vote

Hi! Does .scale(scalingFactorX) work? If im recalling correctly, if you put a number that is less than 1 in .scale (like this --> yourImage.scale(0.8) it will get smaller. If you put a number bigger than 1, like yourImage.scale(1.1), then the image will get bigger

answered by (8 points)

That sounded like it would work, but I just tried it and I keep getting the error "'Image' object has no attribute 'scale'" I think the problem is these methods only work with shapes, so I am not sure if there is a way to do these methods with images.


scale(...) should work on Images too. You are using import graphics2 at the top of your code, right?


I have ' from graphics2 import * ' at the top of my code, but I am still getting the same error about the image object not having an attribute scale.