« CTIN544 - processing script 1 | Main | Key Chinese Govt Agencies Endorsing GDC China 2009 »

CTIN544 - processing script 2

//download the image to the data folder, and choose a movieclip for viewing
kid.png


import processing.video.*;
Movie myMovie;
PImage img;
int pwidth = 194;
int pheight = 246;

void setup() {
size(640, 480);
frameRate(30);

//choose a movieclip, replace the string below with its name
myMovie = new Movie(this, "P1040237.mov");
// Prints the duration of the movie
println(myMovie.duration());
myMovie.play();
myMovie.loop();

img = loadImage("kid.png");
}

void draw() {
if(myMovie.available()) {
myMovie.read();
}
image(myMovie, 0, 0);
blend(img, 0, 0, pwidth, pheight, mouseX-pwidth/2, mouseY-pheight/2, pwidth, pheight, EXCLUSION);
//stroke(255);
//fill(255);
//ellipse(mouseX,mouseY,150,150);
}


Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on January 29, 2009 5:14 PM.

The previous post in this blog was CTIN544 - processing script 1.

The next post in this blog is Key Chinese Govt Agencies Endorsing GDC China 2009.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.31