4 Replies Latest reply on Feb 4, 2015 4:13 AM by yurasic

    ImageSnapshot quits working when not using Flash Builder debugger

    griesdrillmap

      Hey all,

       

      I use the below code to capture and save a screenshot.  It works fine when using the Flash builder to run but it breaks down when moved to another computer or started outside of the builder.  Am I losing a library when using Export Release Build and if so how do I make sure that it will be included in the build.

       

       

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