I am trying to write a method that will take a screenshot of my flex app. I've posted the code below. From what I've seen elsewhere this should be the way to capture everything showing in a flex app in a png image, but when this runs I am only capturing a small piece of the top left of this screen(sized 512x30 pixels). Is there some part of the setup that I am missing?
Thanks in advance,
|var screenshot:ImageSnapshot = ImageSnapshot.captureImage(FlexGlobals.topLevelApplication as IBitmapDrawable, 0, new PNGEncoder, true);|
|var file:FileReference = new FileReference();|
Figured it out. For some reason when the ImageSnapshot.captureImage function is used it uses the default height and width stored in the objects _measuredHeight and _measuredWidth properties instead of using the current size of the screen. These properties need to be set if you want to take a full screenshot.