Converting with Java an SWF to an Image file

Questions on how to use Transform SWF.

Converting with Java an SWF to an Image file

Postby disamistade82 » Tue Feb 16, 2010 12:43 pm

Hello everybody
I should write a java application to convert a SWF file to an image File,
is there a way to do it? Please could you give me some suggestions on how to?

Thank you in advance!
Giulio
disamistade82
 
Posts: 2
Joined: Tue Feb 16, 2010 12:32 pm

Re: Converting with Java an SWF to an Image file

Postby smackay » Tue May 04, 2010 3:18 pm

Sorry for the really late reply - I turned on first post moderation to try and limit the spam the forum was getting.

Rendering a flash file as an image is possible using Transform. I have done it for simple views that contained some images and text. For more complex scenes you probably need to get access to the ActiveX plugin or a commercial application that used it.

Regards,

Stuart
smackay
Site Admin
 
Posts: 594
Joined: Sat Sep 03, 2005 9:04 am

Re: Converting with Java an SWF to an Image file

Postby spcmdr » Fri Sep 10, 2010 3:21 pm

Hi

I would like to have an example of code to do that.
In java I am able to extract image from swf and draw them in a graphics context.
I would like to do the same thing with shape. Is that possible.
I am using the translate-3.0-SNAPSHOT

Regards
spcmdr
 
Posts: 1
Joined: Fri Sep 10, 2010 3:18 pm

Re: Converting with Java an SWF to an Image file

Postby smackay » Mon Dec 13, 2010 9:56 am

It is not possible to provide an example since rendering a frame depends on what the frame displays. It is possible to do it for simple frames that display images and text. Shapes are little harded and if the frame depends on actionscript then rendering it is very difficult indeed.

Stuart
smackay
Site Admin
 
Posts: 594
Joined: Sat Sep 03, 2005 9:04 am

Re: Converting with Java an SWF to an Image file

Postby KevinMajlo » Tue Mar 29, 2011 11:26 am

How complex it is if I want to convert SWF to Bitmap that has only 1 frame but has a lot of objects like DefineFont2, DefineShape3, PlaceObject2, DefineJPEGImage3 and DefineJPEGImage2?

Can you provide an example how to get Image or Text from SWF?
KevinMajlo
 
Posts: 1
Joined: Tue Mar 29, 2011 11:17 am

Re: Converting with Java an SWF to an Image file

Postby smackay » Tue Apr 12, 2011 9:16 am

Kevin

If you want to render a single frame with font and image definitions then that is not too difficult. Rendering images is quite straightforward - simply convert the image data to a BufferedImage and rendering to a Graphics2D object. For font definitions you will have to convert the glyph definitions to shapes and then scale and render the shapes on the Graphics2D.

If the frame is sufficiently complex then you will be, in effect, writing a Flash Player in Java. So you can see that this is a non-trivial problem - otherwise it would have been done already.
What I would suggest is to take a simple movie which moves a shape then try and render that in Java. That should give you a good start at addressing the problem and identifying the issues and from there it should simple be a matter of adding more features :)

The better solution might simple yo use one of the many programs that uses Adobe's OCX plugin and simply convert the movie to an image - these are all Windows only solutions however.

Sorry for the late reply.

Stuart
smackay
Site Admin
 
Posts: 594
Joined: Sat Sep 03, 2005 9:04 am


Return to Using Transform

Who is online

Users browsing this forum: Soituituatems, wiggillellupe and 1 guest

cron