10/19/2010 7:58:10 AM
Title:
AIR application
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
Inder
Points: 2980
Posts:0
10/19/2010 10:02:22 AM
Adobe AIR does not allow to capture desktop, check this article that uses Merapi bridge to capture desktop
http://blog.everythingflex.com/2008/04/24/do-a-screen-capture-with-adobe-air/
10/20/2010 12:46:42 AM
I have never done any experiment in this area.
But i think its possible,
NASDAQ Market Replay AIR application has added this featurs.
check this link and download the trial.
https://data.nasdaq.com/mr.aspx
10/20/2010 1:01:26 AM
Wait...
Here is the working source code.
<?xml version="1.0" encoding="utf-8"?>
<!--Screenshots in adobe air-->
<!--developed by shrikumar-->
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
backgroundColor="0xcccccc">
<fx:Script>
<![CDATA[
import mx.graphics.codec.PNGEncoder;
public function save():void
{
var bd:BitmapData=new BitmapData(width, height);
bd.draw(this);
var ba:ByteArray=(new PNGEncoder()).encode(bd);
(new FileReference()).save(ba, "print.png");
}
]]>
</fx:Script>
<s:Panel y="58"
width="379"
height="293"
title="Panel Name"
horizontalCenter="0"
backgroundColor="0xffcc0f">
</s:Panel>
<s:Button x="278"
y="390"
label="Screen Shot"
click="save()"
horizontalCenter="0"/>
</s:WindowedApplication>
enjoy.. :)
10/20/2010 4:37:39 AM
No I need to take screen shot of total screen not of an part of the application.