Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Fall 2006 Midterm 1 Review: Scaling with input

Questions?


I don't understand which part deals with the scaling and which part deals with the croping???
My guess is that...
sourceY = sourceY + (1.0 / ratio)

sourceX = sourceX + (1.0 / ratio)
...deals with the scaling

and...
sourceX = 50
for targetX in range(300, 300 + int((110 - 50) ratio)):
sourceY = 70
for targetY in range(200, 200 + int((123 - 70) ratio)):
...deals with the croping.

This one is confusing to me. Will someone please help me figure it out.

Thanks!
Megan Bowen
This suggestion wouldn't work too well for an exam, but simply to figure out what is going on at your leisure, what you can do is try the function out with different input values of ratio. Then mutate the code a bit here and there. To see whether the cropping and scaling are done where you think they are, change the numbers in the code systematically and see what the effects are on the resulting image. You can't damage anything by editing the program – it's not a chemistry lab – so experiment. Colin Potts



Link to this Page