// video_capture import processing.video.*; Capture cam; int no = 0; void setup() { size( 320, 240 ); String[] devices = Capture.list(); println( (Object[])devices ); cam = new Capture( this, devices[no] ); cam.start(); } void draw() { image( cam, 0, 0 ); } void captureEvent( Capture cam ) { cam.read(); } void keyPressed() { if (keyCode == ENTER) { //enter save("sample" + no + ".jpg"); print("Capture " + no + " image\n"); no++; } if (key == 'q' || key == 'Q') { exit(); } }