Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert SWF to jpg/jpeg/bmp/png

 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am working on application to convert images from one format to another.
I successfully worked for jpg, jpeg, png & bmp using "javax.imageio.ImageIO" package.

But still i stucked while converting swf to jpg.
If some one help me out to convert swf file to any of the above format. This will be great.


Note - My swf file doesn't having any moving pictures. It cantains only one image i.e just like any othjet bmp or jpeg file holds.

pseudo code to convert jpg/bmp/png to each other formats.


Thanks In Advance
Sharad
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I am aware this can't be done in Java - SWF is after all not an image, its something loaded and run by Flash Player. You'll need to do something like export it in ActionScript to a standard format and load that into Java, or use the Robot class to capture the whole screen and convert that.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's just a single image then Paul's suggestion of using the Robot class is probably easiest.

The JMF and Quicktime for Java libraries can play some Flash files; maybe their API allows to extract individual images.
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ulf,
Could you please keep more high light on your information.

@Paul,
I am going through "java.awt.Robot", there an API "createScreenCapture(Rectangle screenRect)" seems like i need to open that swf then it will take an image and convert it.
My scenario is - my SWF file is in local directory. with out opening that file i need to convert it to other format.
I seems to be an tough task...but i needs to work on it

Is there is any other way to achieve this.
I mean using any plugin or 3rd party jar.

I am using nConvert to convert SVG files to JPEG but it doesn't support for SWF.


~Sharad
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find some links regarding QT4J and JMF in the http://faq.javaranch.com/java/OtherOpenSourceProjectsFaq
 
Herbst Herbst
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tired iWisoft swf to video converter?
It works well for me to convert swf files to many different picture formats.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Herbst Herbst and welcome to Javaranch!

Can you please change your screen name in accordance with our Naming Policy, thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic