Ciao 访客, welcome back to old school! :p
import processing.video.*; PImage myImage;//预存的图像 PImage myImage2;// 取回的图像 PImage[] Image30 = new PImage[30];//30帧的图像数组 int num;//预存计数 int num2;//取图计数 Capture video;//摄像头 int pixelCount;//640*480的像素计数 int xsstart;//预存状态 void setup() { frameRate(30); size(640, 480); video=new Capture(this, 640, 480, 30); video.start(); num=0; num2=0; pixelCount = width*height; xsstart=0;} void draw() { if (video.available()) { video.read(); video.loadPixels(); myImage=loadImage("row.png"); myImage.loadPixels(); for (int i = 0; i < pixelCount; i++) { myImage.pixels[i] = video.pixels[i]; } myImage.updatePixels(); //image(video,0,0); // image(myImage, 0, 0, width/2, height/2); if (num<30) { // Image30.add(myImage); Image30[num]=myImage; num=num+1; } else { xsstart=1; num=0; } if (xsstart==1) { if (num2<30) { myImage2=Image30[num2]; image(myImage2, 0, 0, width, height); num2=num2+1; } else { num2=0; } } }}
我想改变尺寸大小,怎么改了后摄像头就不运行了?