Skip to main content
Participant
October 19, 2010
Question

Take screen shot with AIR application

  • October 19, 2010
  • 5 replies
  • 11824 views

Hi,
Anybody know about how to capture screen shot of our screen with an desktop AIR application? I need to create an desktop app with screenshot taking feature.

Thanks

    This topic has been closed for replies.

    5 replies

    Participant
    May 26, 2014
    Pawel_Cichon
    Participant
    January 16, 2012

    On Windows, you can use this one ...

    https://github.com/pcichon/ScreenShooter

    it uses Native Extensions for AIR ... sources are included.

    Participant
    August 8, 2011

    Allowing AIR applications to take screen shots is a security issue. This should not be made a feature to AIR developers. There is no reason for it. Let the user take control of his/her own screen snapshot instead of letting a rogue AIR app take screen shot instances in the background and transferring to their servers. Also consider multiple screen displays as well - not just the main screen the app is running on.

    I'd be pissed if I had documents up and they were captured and sent to prying eyes by Adobe AIR.

    Participating Frequently
    August 8, 2011

    kkobashi,

    The way you get get around having a "rogue AIR app" taking screenshots is to not install it.  Adobe AIR runs on the desktop and should have the ability to do anything that any other desktop application can do.  The usefulness of giving the user the ability to take a screenshot inside Adobe AIR far outweighs any perceived security risk of some nefairius app that does one thing to trick you to install it, but really sits around taking covert screenshots and sending them to their servers.  Respectfully... you're being paranoid.

    Participating Frequently
    May 10, 2011
    October 19, 2010

    Yes,

    I think you can use the ImageSnapShot class, and thern use the bitmap data from it as you desire.

    You can use the snapshot to take a grab of any element/child in your application or presumably you can take a snapshot of the main application if you want the whole lot.

    I used this method recently to print a screen state.

    var imgWidth:Number = 400;
      
    var img:SWFLoader = new SWFLoader();
    img.id = "appSnapShot";
    var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(myScreenInstance as IBitmapDrawable);
    var imageByteArray:ByteArray = imageSnap.data as ByteArray;
      
    img.load(imageByteArray);
    img.scaleContent = true;
    img.width = imgWidth;
    img.maintainAspectRatio = true;
        
    application.addElement(img);

    Maybe that will help.

    Participant
    October 20, 2010

    Thanks for reply. But I want to take complete screen-shot of the whole screen.

    October 20, 2010

    Try,

    //Hope this logic you have written in your main application

    var imageSnap:ImageSnapshot = ImageSnapshot.captureImage(this as IBitmapDrawable);

    Thanks,

    Bhasker