Flex 3 - Saving an image of a component

Posted by Emma on Stack Overflow See other posts from Stack Overflow or by Emma
Published on 2009-10-07T21:35:19Z Indexed on 2010/04/14 8:33 UTC
Read the original article Hit count: 369

Filed under:
|

Im currently trying to work the imageSnapshot function in flex. Ive been looking hard but I cant seem to find a solution to my problem. I wish to take a screenshot of one of my components, to capture the final output of my program, since a plain "printscreen" cuts off some of the output due to it scrolling. My current code looks like -

<mx:ApplicationControlBar dock="true">
    <mx:Button label="Take snapshot of Profile" 
        click="takeSnapshot();" />
</mx:ApplicationControlBar>

Which when called does -

private function takeSnapshot(even:Event=null):void {
    var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(viewstack1);

Now i think this is taking the image of the viewstack which I want... But Im stumped on what to do from here! Is it not possible to now just copy the image to the clipboard, or produce a new window in my browser with the entire image inside? If anyone has any other way to do this, suggestions would be wonderful.

Thank you for your time.

© Stack Overflow or respective owner

Related posts about flex

Related posts about image