源代码如下:
//截当前场景全图
private function drawCurStageBmp():Bitmap
{
try
{
if(stage==null)return null;
var stageWidth:Number=stage.stageWidth;
var stageHeight:Number=stage.stageHeight;
var bmd:BitmapData=new BitmapData(stageWidth,stageHeight,true);
bmd.draw(stage);
var bmp:Bitmap=new Bitmap();
bmp.bitmapData=bmd;
return bmp;
}
catch(er:Error)
{
trace("截图失败,返回null");
return null;
}
return null;
}