Hi guys, I’m pretty new to Processing but I am using it for my college project. I’m having trouble getting a gif to load after the mouse has been pressed. I know that after the mouse is pressed once it takes a picture but I was wondering if there was a way to have the gif load after the mouse is pressed and the camera stops?
import processing.video.*;
Capture cam;
PImage facescan;
boolean hasClicked;
void setup() {
size(1920, 1080);
background(255);
facescan = loadImage("facescan.gif");
String[] cameras = Capture.list();
if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
} else {
println("Available cameras:");
for (int i = 0; i < cameras.length; i++) {
println(cameras[i]);
}
cam = new Capture(this, cameras[0]);
cam.start();
}
}
void draw() {
if (cam.available() == true) {
cam.read();
}
image(cam, 0, 0, 800, 600);
}
void mousePressed(){
image(facescan, 1920, 1080);
cam.stop();
}