Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 将BitmapData中的3个copyPixels闪存到jpeg屏幕截图中_Actionscript 3_Flash_Screenshot - Fatal编程技术网

Actionscript 3 将BitmapData中的3个copyPixels闪存到jpeg屏幕截图中

Actionscript 3 将BitmapData中的3个copyPixels闪存到jpeg屏幕截图中,actionscript-3,flash,screenshot,Actionscript 3,Flash,Screenshot,我有代码在我的swf中创建舞台的实时屏幕截图。 之后,它保存为jpeg格式。一切都好 只是,我不需要整个舞台,我只需要一个剪影: x、 y:357341 宽,高:319483 我的代码如下所示 在何处以及如何插入copypixels函数 (我是一个Flash新手,所以对我放松点:-) }这应该有助于: var subArea:Rectangle = new Rectangle(0,0, 319,483 ); var newBmp:Bitmap = new BitmapData( 319,483

我有代码在我的swf中创建舞台的实时屏幕截图。 之后,它保存为jpeg格式。一切都好

只是,我不需要整个舞台,我只需要一个剪影:

x、 y:357341 宽,高:319483

我的代码如下所示

在何处以及如何插入copypixels函数

(我是一个Flash新手,所以对我放松点:-)

}这应该有助于:

var subArea:Rectangle = new Rectangle(0,0, 319,483 );
var newBmp:Bitmap = new BitmapData( 319,483 );
var cutoutBmp:Bitmap = new Bitmap( newBmp, PixelSnapping.ALWAYS, true );
cutoutBmp.bitmapData.draw( jpgSource, new Matrix(1, 0, 0, 1, -357, -341) , null, null, subArea, true );

当尝试使用protozoo的答案时,我得到了:“1067:将flash.display:BitmapData类型的值隐式强制转换为不相关的flash.display:Bitmap。”-我遗漏了什么吗?
var subArea:Rectangle = new Rectangle(0,0, 319,483 );
var newBmp:Bitmap = new BitmapData( 319,483 );
var cutoutBmp:Bitmap = new Bitmap( newBmp, PixelSnapping.ALWAYS, true );
cutoutBmp.bitmapData.draw( jpgSource, new Matrix(1, 0, 0, 1, -357, -341) , null, null, subArea, true );