Advertisement
Guest User

Untitled

a guest
Apr 5th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. import processing.video.*;
  2.  
  3. Capture video;
  4. int framecount = 0;
  5.  
  6. void setup() {
  7.   printArray(Capture.list());
  8.   size(1280,720);
  9.   video = new Capture(this, 1280,720);
  10.   video.start();
  11. }
  12.  
  13. void captureEvent(Capture video) {
  14.   video.read();
  15. }
  16. void mousePressed() {
  17.   saveFrame("cap-####.png");
  18. }
  19.  
  20. void draw() {
  21.    copy(video, video.width - (framecount % video.width), 0, 1, video.height, framecount % width, 0, 1, video.height);
  22.    framecount += 1;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement