User Tools

Site Tools


cs276:ex16-5

Note: Default video library does not work in Linux

// Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
 
// Example 16-4: Display QuickTime movie
 
import processing.video.*;
 
// Step 1. Declare Movie object
Movie movie; 
 
void setup() {
  size(320,240);
 
  // Step 2. Initialize Movie object
  // Movie file should be in data folder
  movie = new Movie(this, "cat.mov"); 
 
  // Step 3. Start movie playing
  movie.loop();
}
 
// Step 4. Read new frames from movie
void movieEvent(Movie movie) {
  movie.read();
}
 
void draw() {
  // Step 5. Display movie.
  image(movie,0,0);
}
cs276/ex16-5.txt · Last modified: 2009/11/10 09:42 by scarl