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メソッドを使用してオブジェクトの境界を取得し、境界から と を取得widthできますheight

于 2012-03-01T06:18:08.040 に答える