There are many reasons why it is not working:-
1) you are never using the height with the loader
2)you are capturing the entire application and again adding that image shot inside same application so wht will happen?Let suppose you application
size is 1200 * 800 then how can u add inside the same which is also containing the orginal too.
Pls try this its working fine for any other object:-
<?xml version="1.0" encoding="utf-8"?>
borderColor="red" borderStyle="solid" width="100%" height="100%"
protected function button1_clickHandler(event:MouseEvent):void
var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(canvas1);
var imageByteArray:ByteArray = imageSnap.data as ByteArray;
<mx:Button label="Take screenshot" click="button1_clickHandler(event)"/>
<mx:VBox width="100%" height="100%">
<mx:Canvas id="canvas1" width="500" height="300" backgroundColor="0xFF0000" />
<mx:SWFLoader id="loader" width="500" height="300"/>
Shardul Singh Bartwal
I dont think it is the problem of the loader height or the way in which the loader is used.This is just a sample application i used to illustrate the problem.In the actual scenario i am showing the screenshot in a popup.If you debug the application and take a look at captureImage method in ImageSnapShot,you can see that the width and height of the ImageSnapshot being created is small.I am not sure where exactly and why this is happening.If there is another button next to the take screenshot button in the control bar,the height and width will be reduced such that it will just show the two buttons properly,but ideally i want the whole app screenshot.
Any help guys?