header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
action2n3
Points:200
Posts:0
Answered

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



1
Inder
Points: 2980
Posts:0
Accepted Answer
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/

2
shrikumar
Points: 220
Posts:0
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

3
action2n3
Points: 200
Posts:0
10/20/2010 12:53:11 AM



Thanks for replies.

4
shrikumar
Points: 220
Posts:0
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.. :)

5
action2n3
Points: 200
Posts:0
10/20/2010 4:37:39 AM



No I need to take screen shot of total screen not of an part of the application.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 7+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions