views:

300

answers:

7

Hi all -

I need to take a .swf Flash file, ideally from a URL (but I can read the file from disk also) and create an image preview of it (png, gif or jpeg is fine).

I am using Adobe Coldfusion 8 so I'm looking for a Java solution. I need to get the first frame of the Flash movie only.

Many thanks in advance.

EDIT: I need to do this on the server in Java/CF at runtime - it's got to be automatic - I'm not looking for screen-grab software! :)

A: 

I'm not an expert but I think you can't without some tricky tools because SWF is a compiled flash program.

UPD: but there are some swf2flv converters, maybe u can use them. It is easier to make a preview from flv format.

UPD 2: I see several answers that recommends you to open it in a browser and make a print screen. If you really want to do this, look at JxBrowser.

Roman
It still loads data into memory when it runs, which means it can be accessed, one way or another ;)
Mark Mayo
A: 

Probably not what you're looking for but... Alt+Print Screen would work.. :)

More seriously.. find something that can render flash (IE ActiveX control?) and capture the buffer it renders.

shoosh
+2  A: 

Is this running in a web browser? Or standalone - actually, either works. Simply get it to the point you want, and take a screenshot (Print Screen). That'll giev you an image you can paste into your image app of choice.

IF however you're wanting to code it, you'll need to probably want to try this freeware toolkit:

http://bytescout.com/swftoimage_swf_to_jpg.html

which allows you to take a flash file and convert the first frame to your image type of choice :)

Mark Mayo
This has to be done at runtime via Java. This tool doesn't appear to satisfy that.
Ciaran Archer
You can call out to the OS and execute the app on it, surely? Either interface or run it as a standalone app?
Mark Mayo
A: 

AS3 has the capability to store the pixels that represent the entire screen into a BitmapData object, pass that to a JPG/PNG encoder, and post it to the server. There is a document on Adobe's devnet here that explains how the ActionScript works and what is needed with regard to PHP, shouldn't be hard to translate to CF.

Tegeril
AS3 is no good, I need to get this done on the server, in Java. This solution requires coding in AS3 and the final image is sent to a server for display.
Ciaran Archer
Ah, I see, sorry for the misunderstanding.
Tegeril
+2  A: 

Try swftools. It has utility called swfrender which can export frames into images. And it is open source :).

bhups
A: 

here's an .net article:

http://www.codegod.de/WebAppCodeGod/screenshot-of-webpage-with-aspnet-AID398.aspx

basically you create a webpage showing the .swf flash file.

remember to call iecapt.exe including the command line argument --delay=10000 to give the ie activex control 10sec to load the .swf

mangokun
A: 

see this tutorial,it will help you