[ SM3117 ] - [ Class 09 ] - Images

Class 09 - WebcamXtra Workshop

 

1
Use a temporary image to reduce the bit depth.
2

Define the temporary image object by the image command

_global.img1 = image(160,120,8);

 

3

Copy the webcam image into the temporary image and then copy it to the stage.

function startMovie() {
  _global.img = image(160,120,1);
  _global.display = _movie.stage.image;
  member("webCam").findGlobs = true;
}

 

function exitFrame() {
  var m = member("webCam").cameraImage;
  var r = _global.display.rect;
  _global.img.copyPixels(m,_global.img.rect,m.rect);
  _global.display.copyPixels(_global.img,r,_global.img.rect);
  _movie.go(_movie.frame);
}