问题
i need to extract frame (can be every number ) from flash swf and convert it to jpg/png/.. programmatically what is the best way to do that ? never mind the programming lang
回答1:
Do you have the original .fla files or only the .swf ones?
Anyway, if your using Actionscript 3, then every instance of DisplayObject and its subclasses (Stage, Sprite, MovieClip...) can be captured to a Bitmap. To do that, create a BitmapData object and use its draw method.
It would look like something like this:
do {
bitmapData.draw(someMC);
//then send the data to some server-side page
//using getPixel or some other solution
someMC.nextFrame();
} while (someMC.currentFrame =< someMC.totalFrames)
For more info on how to transfer the image to a server-side page check this: http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php
If you only have the swf file, you can try to load it inside your own swf and run the above code.
回答2:
Check out swfextract, part of swftools. It's a console app so you can easily drive it from your own software.
来源:https://stackoverflow.com/questions/528692/how-to-extract-flash-frames-programmatically