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.  
Class   Capture
   
Name  

crop()

   
Examples  
import processing.video.*; 
Capture myCapture; 
 
void setup() 
{ 
  size(200, 200); 
  print(myCapture.list()); 
  String s = "Logitech QuickCam Zoom-WDM"; 
  myCapture = new Capture(this, s, width, height, 30); 
  myCapture.crop(10, 10, 180, 180); 
} 
 
void captureEvent(Capture myCapture) { 
  myCapture.read(); 
} 
 
void draw() { 
  image(myCapture, 10, 10); 
} 
 

Description   Crops the frame coming in from the camera. It seems common for cameras add lines to the top or bottom of an image and this can be useful for removing them. The parameters are affected by the current imageMode() from the parent applet. The imageMode() function changes the way the parameters work. For example, imageMode(CENTER) will change x and y to define the center of the image. A call to imageMode(CORNERS) will change the width and height parameters to define the x and y values of the opposite corner of the image.
   
Syntax  
cam.crop(x, y, width, height)
   
Parameters  
cam   any variable of type Capture

x   int or float: x-coordinate of the image

y   int or float: y-coordinate of the image

width   int or float: width to display the image

height   int or float: width to display the image

   
Usage   Web & Application
   
 
 






   
 
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  
eativecommons.org/licenses/by-nc-sa/2.0/" /> -->     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