6
TECHNOLOGY CLUB Week 11

Week 11. Picture Taking Functions takePicture(“color” | “gray”) Returns a picture object Show(picture object) Will show the picture that was taken

Embed Size (px)

Citation preview

Page 1: Week 11. Picture Taking Functions  takePicture(“color” | “gray”) Returns a picture object  Show(picture object) Will show the picture that was taken

TECHNOLOGY CLUBWeek 11

Page 2: Week 11. Picture Taking Functions  takePicture(“color” | “gray”) Returns a picture object  Show(picture object) Will show the picture that was taken

Picture Taking Functions

takePicture(“color” | “gray”)Returns a picture object

Show(picture object)Will show the picture that was taken on the

screen

Page 3: Week 11. Picture Taking Functions  takePicture(“color” | “gray”) Returns a picture object  Show(picture object) Will show the picture that was taken

A = takePicture(“color”) or A = takePicture(“gray”)

A is a variable and can be any name, but is now a picture object

Taking Pictures with Variables

Page 4: Week 11. Picture Taking Functions  takePicture(“color” | “gray”) Returns a picture object  Show(picture object) Will show the picture that was taken

L = [] L.append(takePicture(“color”)) L is a list object and each time you call

append it adds to the List. Saving List as a animated GIF(Graphics

Interchange Format)savePicture(pictures, “c:\\temp\\movie.gif”)Open c:\temp\movie.gif

Taking Pictures with List

Page 5: Week 11. Picture Taking Functions  takePicture(“color” | “gray”) Returns a picture object  Show(picture object) Will show the picture that was taken

Take a Picture

Use your robots to take a picture and then show a picture, in the python shell

Do the same thing, but write it into a program (.py file)

Page 6: Week 11. Picture Taking Functions  takePicture(“color” | “gray”) Returns a picture object  Show(picture object) Will show the picture that was taken

Create an adventure movie Write a program (.py file) that will tell

Scribbler to take pictures of the objects that we have on the floor

Then save them to a movie that we can play.