Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+3 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 (2.7k points)
+1

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 (5.5k points)
0

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.

0

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

0

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.

...