FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Back  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

captureEvent()

   
Examples  
import processing.video.*; 
Capture myCapture; 
 
void setup() 
{ 
  size(200, 200); 
  // The name of the device is dependent on what's 
  // plugged into the computer. To get a list of the 
  // choices, uncomment the following line 
  // println(Capture.list()); 
  String s = "Logitech QuickCam Messenger-WDM"; 
  myCapture = new Capture(this, s, width, height, 30); 
} 
 
void captureEvent(Capture myCapture) { 
  myCapture.read(); 
} 
 
void draw() { 
  image(myCapture, 0, 0); 
} 
 


import processing.video.*; 
Capture myCapture; 
String[] caps; 
 
void setup() 
{ 
  size(200, 200); 
  caps = Capture.list() 
  myCapture = new Capture(this, caps[0], width, height, 30); 
  myCapture = new Capture(this, caps[1], width, height, 30); 
} 
 
void captureEvent(Capture c) { 
  if(c == caps[0]) { 
    myCapture.read(); 
  } else if (c == caps[1]) { 
    myCapture.read(); 
  } 
} 
 
void draw() { 
  image(myCapture, 0, 0); 
} 
 

Description   Called when a new camera frame is available. Use the read() method to capture this frame. If there is more than one capture device in the program, captureEvent() is called each time any of the devices has a new frame available. Use an if() to determine which device is triggering the event. See the above example for implementation details.
   
Syntax  
void captureEvent(Capture which) {
  statements
}
   
Parameters  
statements   any valid statements

which   the camera with the event

   
Usage   Web & Application
   
Related   Capture
 
 






   
 
Updated: Fri Jul 15 16:41:05 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info  
tle>Casey Reas -->     Processing is an open project initiated by Ben Fry and Casey Reas     © Info   Casey Reas et al. Casey Reas -->     Processing is an open project initiated by Ben Fry and Casey Reas     © Info   A versatile input provider, a popup window with a set of interactive