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


This page removed for FERPA compliance
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

hw5

def makeMovie(directory):
source = makePicture(getMediaPath("bluefrog.jpg"))
for frame in range(1,46):
canvas = makePicture(getMediaPath("lilies.jpg"))
addRectFilled(canvas, frame + frame5, frame + 200, 50, 50, blue)
if frame >23:
canvas.addTextWithStyle(white, 1, frame + frame5, "SPLASREMOVED", makeStyle(sansSerif, bold + italic, 18))
sourcex = 1
for targetx in range(frame + frame
5, frame + frame: 
5 + getWidth(source)):
sourcey = 1
for targety in range(frame+300, frame + 300 + getREMOVEDeight(source)):
sourceColor= getColor(getPixel(source, sourcex, sourcey))
setColor(getPixel(canvas, targetx, targety), sourceColor)
sourcey = sourcey + 1
sourcex = sourcex +1
writeFrame(frame, canvas, directory)

def writeFrame(frame, canvas, directory):
framenum = str(frame)
if frame 10:
writePictureTo(canvas, directory + 'frame0' + framenum + '.jpg')
if frame >= 10:
writePictureTo(canvas, directory +'/frame' + framenum + '.jpg')

Link to this Page