Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

How do I make the white square stay over the webcam?

$
0
0
Hi everyone!! Anyone who could help me out with this? I am trying to make the trail of the white square stay over the webcam's image. How can i do that??

this is the code I have written so far....


import processing.video.*;
Capture cam;

void setup() {
  size(640, 536, P2D);
 
  cam = new Capture(this,width, height);
    cam.start();
}
void draw() {

  // draw grey rectrangle
  stroke(255);
  fill(255);
  rectMode(CENTER);
  rect(mouseX,mouseY,50,50);
      if (cam.available() == true) {
  cam.read ();
  image(cam,0,0);
    }
}



Thank you very much!

Viewing all articles
Browse latest Browse all 1768

Trending Articles