I've been working on this code which has a live feed of a webcam in the centre of the screen, and when you press 'a' it takes a screen shot, and then displays it in a grid on the screen around the live feed. The problem is that it takes a full screen shot, so all the photos around the web cam are smaller, can anyone suggest something?
Thanks
heres the code so far:
import processing.video.*;
int w = 640;
int h = 480;
int fps = 25;
int i = 0;
PImage img;
PImage img2;
PImage img3;
PImage img4;
PImage img5;
PImage img6;
PImage img7;
PImage img8;
Capture cam;
void setup()
{
size(screen.width, screen.height, P3D);
frameRate(fps);
cam = new Capture(this, w, h);
img = loadImage("person-1.tif" );
img2 = loadImage("person-2.tif" );
img3 = loadImage("person-3.tif" );
img4 = loadImage("person-4.tif" );
img5 = loadImage("person-5.tif" );
img6 = loadImage("person-6.tif" );
img7 = loadImage("person-7.tif" );
img8 = loadImage("person-8.tif" );
}
void draw()
{
//drop blue moon logog in here
if (cam.available() == true) {
cam.read();
}
image(cam, width/3, height/3, width/3, height/3);
//}else{
//image(
// image(
//}
tint(17);
noTint();
image(img, 0, 0, width/3, height/3);
image(img2, width/3, 0, width/3, height/3);
image(img3, 2*width/3, 0, width/3, height/3);
image(img4, 0, 266, width/3, height/3);
image(img5, 2*width/3, 266, width/3, height/3);
image(img6, 0, 532, width/3, height/3);
image(img7, width/3, 532, width/3, height/3);
image(img8, 2*width/3, 532, width/3, height/3);
if (keyPressed == true) {
if (key == 'a') {
filter( BLUR, 3 );
filter( POSTERIZE, 12 );
if (i < 8) {
i++;
}
else i = 0;
saveFrame ("person-"+i);
}
// if (key == 'b') {
// image(img, 0, 0, 200, 200);
// }
}
}