Taking screenshots in Flex 3 using the ImageSnapshot.captureBitmapData() method

private function takeSnapshot(source:IBitmapDrawable):void
{
var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData(source);
swfLoader.source = new Bitmap(imageBitmapData);
}

<mx:DataGrid id=”dataGrid” dataProvider=”{arr}” />
<mx:Button label=”Take snapshot of DataGrid”  click=”takeSnapshot(dataGrid);” />

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s