1 Reply Latest reply on Apr 24, 2012 9:40 AM by griesdrillmap

    ImageSnapshot taking incomplete image of screen

    griesdrillmap

      Hey all,

       

      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,

      matt

       

      var screenshot:ImageSnapshot = ImageSnapshot.captureImage(FlexGlobals.topLevelApplication as IBitmapDrawable, 0, new PNGEncoder, true);
      var file:FileReference = new FileReference();
      file.save(screenshot.data, "chart.png");