Window screen capture on Adobe Flex? - apache-flex

Is there a way to take screenshot of the client's window using flex?
I found an example which uses java bridge, but i am looking for different solution.

Do you want to take a snapshot of the users screen? OR just of the AIR App?
If you want to take a screencap of the user's screen, I'd look into NitroScreenCap. The 'generic' approach they use is that they wrote native code for each operating system and pack it up with the AIR app using a NativProcess. I guess you could try to implement that yourself if needed.
If you just need a screencap of the Flex app; do some Googling. You can get the BitMapData of any given Flex Component and turn that into an image. Here are a few links that come up:
http://blog.flexexamples.com/2007/11/16/taking-screenshots-in-flex-using-the-imagesnapshotcaptureimage-method/
http://dougmccune.com/blog/2007/06/03/save-a-snapshot-image-of-a-flex-app-without-a-server/
http://www.mehtanirav.com/taking-a-snapshot-of-flex-app-from-flex/

Related

Take a screenshot in flex4

I am building a widow AIR application. My application is transparent . I need to take a screenshot of my screen .Please help me in this
AIR cant do it directly; but it can be done by creating an Air Native Extension (ANE) to talk to the OS and grab the bitmap data.
Or you could try Native Process (not sure it ifs still part of AIR now that we have ANEs). Heres a tutorial on using Native Process to take a screenshot: http://www.gotoandlearn.com/play.php?id=125

Camera overlay with flex mobile

I would like if it possible to have a mask overlay over the camera using flex mobile framework. I need to develop a cross platform (android/iOS) application using camera on which I want to display buildings. So I know it is possible with native iOS and android code. But I would like to do it with flex mobile.
Do you know if it only possible or not ?
Thansk a lot.
Best regards
Using Adobe Air's camera class, you cannot manipulate the picture this way.
You can change quality, sizing, frame rate etc., but cannot manipulate the image so it will show additional data except data received from the device.

What's the difference between stage video and spark video display?

I'm a little confused on the terms. I understand that the spark framework has a video player and a video display. The difference being that video display doesn't have the video controls.
I know that stage video is new in AIR3 and uses hardware acceleration to play videos.
My question is, does videodisplay and videoplayer take advantage of stage video out of the box? Do I need to implement it another way?
After doing some research StageVideo for AIR desktop and extended desktop profiles is not available.
There seems to be an announcement about AIR in the coming days. Hopefully they put this on the road map. Some adobe guys hinted that this is coming.
I don't find any references to it within VideoDisplay and I don't see anything in VideoPlayer regarding StageVideo, plus from reading this article it sounds to me like they would keep them as two completely separate beasts, due to the possibility that the GPU is already in use and therefore can't be used at any given point in time (just what it sounds like to me). http://corlan.org/2010/12/01/working-with-stage-video/
Also when I Ctrl+Shift+T to get to VideoDisplay and VideoPlayer it specifically notes that they aren't optimized for mobile, which it seems is the main purpose for the new class (it's built in to the flash player it seems so I can't access the source).
If you're looking for something with pre-packaged controls and that can take advantage of the new StageVideo, check out the open source media framework (OSMF) says they support it in versions > 1.6. http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCUQFjAA&url=http%3A%2F%2Fblogs.adobe.com%2Fosmf%2F2011%2F02%2Fgetting-started-with-stage-video-support-in-osmf-and-strobe-media-playback.html&ei=gbo6T46qKIyXtwedwonzCg&usg=AFQjCNHpm7AV9MZHw79TZjAs_nIZc-qoow&sig2=45WDlwOlB60uMzivf1fZOw

.NET : How to Create thumbnail from flash

Is there any way where i can create a thumbnail image from a flash movie file(flv /swf) [NOT FROM A VIDEO File ] in ASP.NET ? Any samples of implementation ?
you can use ffmpeg to create thumbnails of the flash video
For .flv you can use ffmpeg to convert parts of the video (e.g. one frame) into an image (sequence)
I've used it as command-line application by calling Process.Start(), but there is at least one wrapper for .NET (I haven't tested it myself):
http://www.codeplex.com/ffmpegdotnet
For .swf I don't know any way to achieve this without some Adobe tool.
for flv it can be done easily, as others mentioned ...
for swf, it depends HIGHLY on the swf ... if the swfs visual appearence is determined by code, there is no other way than to embed a flash player in you app and either let the flash player make the snapshots, encode them as JPEG/PNG, and send them somewhere using TCP or LocalConnection (a flash<->flash communication connection, which can be used with C# as well) or try to somehow grab its output buffer yourself ... the first possibility should be no more than 10-20 lines of actionscript code ... don't know about the latter ...
other than that, you might use an external command line converter ... there are a few floating around the web ...
greetz
back2dos
Take a look at this article, it should point you in the right direction. It uses SharpFFmpeg to extract thumbnail images from movie clips from a variety of formats.
the only way to get an image, is to use a full flash client that starts playing and allows you to capture the first frame.
I would take a close look at flirt (they actually have an example that renders pngs)
Maybe some of the other flash libraries may be of help ( swfdec gnash swift tools gplflash)
Gnash is probably the best choice since its the most mature project out there, but i do not know how easy it is to integrate into command line tools or into your own projects.
We have been working on this in my company, and we got a proof of concept working pretty fast (but the project we made it for is on hold right now). I am not able to share the code, but I can give you some pointers.
It is not pure ASP.NET, but maybe you can still use it. We made a windows service that can be called from ASP.NET.
Basicly you install the flash plugin on the server, the windows services can then simply open the swf through the swf ActiveX component and then you can grap a picture of the whole thing. It works pretty well, notice that you do not have to actually render the ActiveX component on screen to capture the picture.
Check out this post. It does not tell you everything but I guess it provides the ground work required for it. You probably have to figure out how to get the object tag out of the flash-html you are trying to download from a web page. After that you'd have to figure out when to capture the frames. Its a long ride however. You don't need the asp.net part. Just concentrate on the windows project part. Hope this helps. :)

Create a webbrowser in Flex?

Is it possible to create a webbrowser inside a Flex (not AIR!) application?
I want to display some links in a Flex application and when a user clicks the links, it should open a custom component with some sort of a webbrowsing component. Is it possible?
Check this out:
http://www.deitte.com/archives/2006/08/finally_updated.htm
has a great example
if that doesn't work for you, look at this:
http://code.google.com/p/flex-iframe/
Short answer - no. There are some simple html rendering capabilities built-in but that's probably not what you're looking for.
Long answer - it's possible inside browser, eg. using IFrame, or using AIR, which has a built in broswer. If having an exe file and not an AIR file is a problem, AIR 2.0 allows you to create native application installers. Check it at Adobe labs.

Resources