how to extract flash frames programmatically

只愿长相守 提交于 2019-12-21 21:25:18

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!