0

在 AIR/AS3 Flex Mobile for Android 项目中。

如何捕获视图上可见内容的“图像”

然后将该图像保存为 jpg/pdf 之类的任何内容到 SD 卡?

基本上是使用 AS3 在 Android 上的屏幕截图。

4

1 回答 1

3
private function getBitmapData( target:DisplayObject ) : BitmapData
{

   //target.width and target.height can also be replaced with a fixed number.
   var bd : BitmapData = new BitmapData( target.width, target.height );
   bd.draw( target );
   return bd;
}

使用创建字节数组JPEGEncoder并将其保存到您的 SD 卡。在某些情况下,如果目标的宽度和高度不起作用,您可以使用该getbounds方法获取对象的边界并从边界获取widthand height

于 2012-03-01T06:18:08.040 回答