 |  |

 |
 |  |  |
 | Welcome to CS1315. Click on the python to add comments.
|  |
 |  |  |
|
This page removed for FERPA compliance
|
        |
Making a copy of a picture
REMOVEDnction to make a copy of a picture pic and save it as "copy.jpg" in whatever folder has been defined as the mediapath.
def copyPicture(pic):
canvas = makeEmptyPicture(getWidth(pic), getHeight(pic))
for x in range(1, getWidth(pic)):
for y in range(1, getHeight(pic)):
fromPixel = getPixel(pic, x, y)
toPixel = getPixel(canvas, x, y)
setColor(toPixel, getColor(fromPixel))
writePictureTo(canvas, getMediaPath("copy.jpg"))
Link to this Page