发个防制品源码!!!复制内容到剪贴板
代码:
var cam:Camera;
for (var d:Number = 0; d<Camera.names.length; d++) {
attachMovie("txt_mc", "txt_mc"+d, d, {_x:0, _y:50+d*56});
this["txt_mc"+d]._txt.text = Camera.names[d];
this["txt_mc"+d].id = d;
this["txt_mc"+d].onRelease = function() {
cam = Camera.get(this.id);
start_func();
};
}
function start_func() {
cam.setMode(cam.width, cam.height, 25);
video.attachVideo(cam);
var depth_num:Number = 0;
var list_array:Array = new Array();
_bmp = new flash.geom.Matrix();
now = new flash.display.BitmapData(video._width, video._height);
out = new flash.display.BitmapData(video._width, video._height);
this.createEmptyMovieClip("out_mc", 50);
out_mc.attachBitmap(out, 1);
out_mc._x = 100;
out_mc._y = 50;
this.onEnterFrame = function() {
now.draw(video, _bmp);
done = now.clone();
done.draw(before, _bmp, null, "difference");
done.threshold(done, done.rectangle, done.rectangle.topLeft, ">", 0xff1112c8, 0xffff00f0, 0xffffff, false);
list_array.push(done.clone());
if (list_array.length>5) {
list_array.shift().dispose();
}
out.fillRect(out.rectangle, 0);
before = now.clone();
for (var d:Number = 0; d<list_array.length; d++) {
out.threshold(list_array[d], out.rectangle, out.rectangle.topLeft, "==", 0xffff00f0, -65536, 0xffffff, false);
}
};
}
stop();[
本帖最后由 终极讨厌 于 2007-7-22 09:01 编辑 ]