2 Replies Latest reply on Sep 27, 2006 3:24 AM by Newsgroup_User

    Using code to export SWF frame as image

    officermcnulty
      Hi - I currently deal with a customer who has a large number of dynamically generated SWF movies. For various purposes they would like to be able to generate images (for example of the first frame only) of a SWF on demand, and potentially there would be multiple concurrent requests to do so. Does anyone know if there is a component, Dot Net DLL or any other programmatic mechanism for exporting a single SWF frame to JPG or PNG format, but without displaying the flash control or other visual interface, and that supports multiple concurrent calls?
        • 1. Re: Using code to export SWF frame as image
          TimSymons Level 1
          I know that the BitmapData class can take the current image of a movieclip. You can probably dig up some AS routines to convert it into a JPG.

          Tim
          • 2. Re: Using code to export SWF frame as image
            Level 7
            officermcnulty wrote:
            > Hi - I currently deal with a customer who has a large number of dynamically
            > generated SWF movies. For various purposes they would like to be able to
            > generate images (for example of the first frame only) of a SWF on demand, and
            > potentially there would be multiple concurrent requests to do so. Does anyone
            > know if there is a component, Dot Net DLL or any other programmatic mechanism
            > for exporting a single SWF frame to JPG or PNG format, but without displaying
            > the flash control or other visual interface, and that supports multiple
            > concurrent calls?
            >

            Sounds like you need a SWF renderer. Based on the complexity of your
            SWFs, it's no an easy thing to do.

            I would look into the various Open Source Flash player implementations
            out-there to use their rendering code. I haven't digged into this myself
            much but it may require a fair bit of coding on your side, plus be aware
            that these open source flash player generally do not support all
            features of Flash.

            There is one SWF rendering library here:
            Flirt: http://flirt.sourceforge.net/

            And some open source Flash players here:
            * gameSWF: http://tulrich.com/geekstuff/gameswf.html
            * Gnash (based on gameSWF): http://www.gnu.org/software/gnash/
            * swfDEC: http://swfdec.sourceforge.net/


            Good luck.
            Tim.