ahora bien, el caso es el siguiente, quiero dibujar dentro del espacio definido por "Camera" y lo que dibuje alli guardarlo en el disco... entonces no encuentro como hacer que "Camera" capte esto y lo guarde, solo me guarda la imagen que puse de fondo en el camera de prueba, pero sin lo que dibujo encima...
aqui ambos scripts
DIBUJAR LINEA CON FILTRO DESGRADADO
Código :
this.createEmptyMovieClip("dibujar_mc",this.getNextHighestDepth());
this.onMouseDown = function(){
colores = [0xFF0000, 0x0000FF];
dibujar_mc.lineStyle(5,0x990000);
alphas = [100, 100];
radios = [0, 0xFF];
matrix = {a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1};
spreadMethod = "reflect";
interpolacionMethodo = "linearRGB";
focalPointRatio = 0.9;
dibujar_mc.lineGradientStyle("linear", colores, alphas, radios, matrix, spreadMethod, interpolacionMethodo, focalPointRatio);
endFill();
dibujar_mc.moveTo(_xmouse,_ymouse);
onMouseMove = function(){
dibujar_mc.lineTo(_xmouse,_ymouse);
}
}
this.onMouseUp = function(){
onMouseMove = noLine;
}
limpiar.onRelease = function(){
dibular_mc.removeMovieClip();
}
CODIGO PARA GUARDAR LA IMAGEN EN PNG EN EL DISCO
Código :
import flash.display.BitmapData;
import com.quasimondo.display.BitmapExporter;
var webcam:Camera = Camera.get();
image_mc.cam.attachVideo(webcam);
// This is the bitmap that we draw() the camera picture in
// and which will be saved:
var snapshot:BitmapData = new BitmapData(160,120,false);
// You will have to change the gatewayURL to your server
// except if you are testing this locally:
BitmapExporter.gatewayURL = "http://localhost/BitmapExporter/PHP/BitmapExporter.php";
// It is a good idea to listen to the various events that
// BitmapExporter provides:
BitmapExporter.addEventListener( "progress", this);
BitmapExporter.addEventListener( "status", this);
BitmapExporter.addEventListener( "error", this);
//BitmapExporter.addEventListener( "complete", this);
function save():Void
{
// Check if there is still an export going on:
if (BitmapExporter.getStatus() == "idle") {
// update the bitmap with the latest camera image:
snapshot.draw( image_mc );
progress_back._visible = progressbar._visible=true;
// this is only to compare the different speeds
timer = getTimer();
onEnterFrame = updateTimer;
// Since the webcam image is very small we can get away with turboscan here:
BitmapExporter.saveBitmap(snapshot, "snapshot.png", "turboscan", 0 );
// Usually it is receommended to use one of the other modes:
// BitmapExporter.saveBitmap(snapshot, "snapshot.jpg", "fastscan", 0, 70);
// BitmapExporter.saveBitmap(snapshot, "snapshot.jpg", "default", 0, 70);
// BitmapExporter.saveBitmap(snapshot, "snapshot.jpg", "palette", 0, 70);
// BitmapExporter.saveBitmap(snapshot, "snapshot.jpg", "rgb_rle", 0, 70);
}
}
function updateTimer(){
time.text = getTimer() - timer;
}
function cancel():Void {
cancel_btn.enabled = false;
cancel_btn._visible = false;
BitmapExporter.cancel();
}
function progress(evt:Object):Void {
progressbar.setProgress(evt.current, evt.total);
progressbar.label = evt.message+" (%3%%)";
}
function error(evt:Object):Void {
errormsg.text += evt.message+"\n";
delete onEnterFrame;
trace( evt.message )
}
function status(evt:Object):Void {
trace( evt.status );
switch (evt.status) {
case "negociando con el servidor" :
save_btn._visible = false;
save_btn.enabled = false;
cancel_btn._visible = true;
cancel_btn.enabled = true;
break;
case "idle" :
progress_back._visible = progressbar._visible=false;
save_btn.enabled = true;
save_btn._visible = true;
cancel_btn.enabled = false;
cancel_btn._visible = false;
onEnterFrame = null;
break;
case "devolviendo":
onEnterFrame = null;
break;
}
}
cancel_btn.onPress = function() {
this._parent.cancel();
};
save_btn.onPress = function() {
this._parent.save();
};
progress_back._visible = progressbar._visible=false;
cancel_btn._visible = false;
save_btn._visible = true;
progressbar.minimum = 0;
cancel_btn.enabled = false;
var timer:Number
var errormsg:TextField;
Ojala alguien me ayude rapidito con esto...gracias
