unread,
Sep 7, 2007, 3:13:06 PM9/7/07
to Flex India Community
it is possible in Flex 2 we take screen shot from current page and
also save this image in file format like (jpg, png etc)?
unread,
Sep 7, 2007, 4:44:41 PM9/7/07
to Flex India Community
Hi Vaibhav,
Yes its possible to take a screenshot of your flex application right
from inside in flex. You can create a BitmapData representation of
your application and then use that as image.
I have modified an example from
http://blog.flexexamples.com/2007/08/03/creating-flv-cuepoint-thumbnails-using-the-bitmap-and-bitmapdata-classes/#more-53
to capture the screen of the flex app. The modified code logic goes
like this:-
1. You create a BitmapData representation of your flex app by passing
"Application.application as DisplayObject" to BitmapData
The code is here:-
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical" verticalAlign="middle" backgroundColor="white">
<mx:Script>
<![CDATA[
import mx.events.CuePointEvent;
import mx.collections.ArrayCollection;
[Bindable]
private var arrColl:ArrayCollection = new
ArrayCollection();
private function copyBitmap(source:DisplayObject):Bitmap {
var bmd:BitmapData = new BitmapData(source.width,
source.height);
bmd.draw(source);
return new Bitmap(bmd);
}
private function
videoDisplay_cuePoint(evt:CuePointEvent):void {
var bm:Bitmap = copyBitmap(Application.application as
DisplayObject);
arrColl.addItem({bitmap:bm,
cuePointName:evt.cuePointName, cuePointTime:evt.cuePointTime,
cuePointType:evt.cuePointType});
}
]]>
</mx:Script>
<mx:Panel id="panel" layout="horizontal" title="Panel">
<mx:HBox paddingLeft="5" paddingRight="5" paddingTop="5"
paddingBottom="5" backgroundColor="black">
<mx:VideoDisplay id="videoDisplay" source="http://
www.helpexamples.com/flash/video/cuepoints.flv"
cuePoint="videoDisplay_cuePoint(event)" top="5" />
</mx:HBox>
<mx:TileList id="tileList" columnCount="1"
dataProvider="{arrColl}" width="{videoDisplay.width}"
height="{videoDisplay.height + 10}"
verticalScrollPolicy="on">
<mx:itemRenderer>
<mx:Component>
<mx:HBox paddingBottom="0" paddingTop="0">
<mx:Image source="{data.bitmap}"
toolTip="{data.cuePointTime}" maintainAspectRatio="true" scaleX="0.5"
scaleY="0.5" />
<mx:Text textAlign="left">
<mx:htmlText>name: <b>
{data.cuePointName}</b><br />time: {data.cuePointTime}
<br />type: {data.cuePointType}</mx:htmlText>
</mx:Text>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
</mx:Panel>
</mx:Application>
Note:- This will not capture the users entire screen. Flash player
security features wont allow flex to capture the entire screen
Regards,
-Sindhu
unread,
Sep 7, 2007, 6:41:23 PM9/7/07
to flex_...@googlegroups.com
Just note there is crossdomain security sandbox, images/videos from other domains might not be captured. To capture them, you need to take care of crossdomain.xml.
-abdul
unread,
Sep 8, 2007, 6:59:09 AM9/8/07
to Flex India Community
Thanks Sindhu
but we need full screen capture and also save the data base picture
format like (jpg, png etc).
if you have any idea then Share with me.
Vaibhav
On Sep 7, 7:44 pm, Sindhu <smart.cs.g...@gmail.com> wrote:
> Hi Vaibhav,
>
> Yes its possible to take a screenshot of your flex application right
> from inside in flex. You can create a BitmapData representation of
> your application and then use that as image.
>
> I have modified an example fromhttp://blog.flexexamples.com/2007/08/03/creating-flv-cuepoint-thumbna...
unread,
Sep 8, 2007, 6:59:56 AM9/8/07
to Flex India Community
Thanks Abdul
but we need full screen capture and also save the data base picture
format like (jpg, png etc).
if you have any idea then Share with me.
Vaibhav
On Sep 7, 9:41 pm, "Abdul Qabiz" <abdul.qa...@gmail.com> wrote:
> Just note there is crossdomain security sandbox, images/videos from other
> domains might not be captured. To capture them, you need to take care of
> crossdomain.xml.
>
> -abdul
>
> On 9/7/07, Sindhu <smart.cs.g...@gmail.com> wrote:
>
>
>
> > Hi Vaibhav,
>
> > Yes its possible to take a screenshot of your flex application right
> > from inside in flex. You can create a BitmapData representation of
> > your application and then use that as image.
>
> > I have modified an example from
>
> >http://blog.flexexamples.com/2007/08/03/creating-flv-cuepoint-thumbna...
unread,
Sep 10, 2007, 5:31:12 AM9/10/07
to Flex India Community
unread,
Sep 10, 2007, 12:17:44 PM9/10/07
to flex_...@googlegroups.com
unread,
Sep 10, 2007, 10:11:50 PM9/10/07
to flex_...@googlegroups.com
Can't we take the Base64Encoded string to DOM and copy this to clipboard?
Reply all
Reply to author
Forward