|
|||
|
hi ,in our project ,we need to capture a image for a specified MovieClip.I have noticed the Image.CaptureMovie method ,but this method dosen't accept a parameter. it capture
the _root MovieClip. we can't set other MovieClip's visible property to false because the capture operation call by program in a interval. thanks. |
|
|||
|
hi,
you can check out this interesting project... http://www.quasimondo.com/archives/000572.php Ariel. |
|
|||
|
hi thanks.
I have read the post .but the encode in the flash side is a little slow.we need more effective way to capture a MovieClip and save it to a accesss DataBase included in the exe file produced by swfkit. |
|
|||
|
I know I can specify a area to capture. but it is not what i need . because if the MovieClip I want to capture have transparent area it will capture the background.what i need is just capture a MovieClip.
May be I can use BitmapData to capture Image .then encode it to ByteArray.But how can I send ByteArray to FFish and save it to hard drive or database.Can FFish handle ByteArray from Actionscript ? |
|
|||
|
Yes, the following sample shows how to save a bitmap file
http://www.topcmm.com/forum/index.ph...c=1721.0;id=89 |
|
|||
|
It does work. The following is the actionscript 2 code that works well
Code:
stop();
import flash.external.*;
import flash.display.BitmapData;
// calling a ffish script function
function saveBitmap(width, height, data)
{
return ExternalInterface.call("saveBitmap", width, height, data);
}
function onSave()
{
var bitmapData = new BitmapData(myImage._width, myImage._height, false);
bitmapData.draw(myImage);
var dr:Array = new Array();
var w, h;
for (h = bitmapData.height - 1; h >= 0; h--)
{
for (w = 0; w < bitmapData.width; w++)
{
var color = bitmapData.getPixel(w, h);
dr.push(color);
}
}
trace(dr);
saveBitmap(bitmapData.width, bitmapData.height, dr.toString());
}
saveBtn.addEventListener("click", onSave);
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|