我写了一个简单的代码来使用带有叠加层的网络摄像头功能,但是当我尝试捕捉图片时它只是网络摄像头图片,无论如何我可以在保存时将叠加和网络摄像头图片组合在一起吗?
import processing.video.*;
int w = 1280;
int h = 720;
int i = 0;
Capture camDevice;
PImage overlay;
void setup() {
size(w, h);
camDevice = new Capture(this, w, h);
camDevice.start();
}
void draw() {
overlay = loadImage("overlay.png");
if (camDevice.available() == true) {
camDevice.read();
}
image(camDevice, 0, 0);
image(overlay, 0, 0, width, height);
}
void keyPressed() {
if ( key == 's' ) {
if (i<300){
i++;
} else i = 1;
//camDevice.save( "stillFrame"+i+".png" );
saveFrame("Frame-"+i+".png"); //Found this in the library that does exactly what i wanted
}
}
答案 0 :(得分:0)