Advertisement
xeromino

cam

Mar 6th, 2017
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. // Step 1. Import the video library.
  2. import processing video.
  3.  
  4. //Step 2. Declare a capture object.
  5. Capture video;
  6.  
  7. void setup() {  
  8.   size(320, 240);
  9.  
  10.   // Step 3. Initialize Capture object.
  11.   video = new Capture(this, 320, 240);
  12.  
  13.   // Step 4. Start the capturing process.
  14.   video.start();
  15. }
  16.  
  17. // Step 6. Display the image.
  18. void draw() {  
  19. image(video, 0, 0);
  20. }
  21.  
  22. // Step 5. Read from the camera when a new image is available!
  23. void captureEvent(Capture video) {
  24.   video.read();
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement