如何以编程方式提取Flash帧 [英] how to extract flash frames programmatically
问题描述
我需要从闪存swf中提取帧(可以是每个数字),并将其转换为jpg / png / ..编程
这是做什么最好的方法?没关系编程lang
你有原始的.fla文件还是只有.swf的? b
$ b无论如何,如果你使用Actionscript 3,那么每一个 DisplayObject
及其子类( Stage $> c $ c>,
Sprite
, MovieClip
...)可以被捕获到位图。为此,创建一个 BitmapData
对象并使用它的 draw
方法。
do {
bitmapData.draw(someMC); $ b 它看起来像这样:
//然后将数据发送到服务器端页面
//使用getPixel或其他解决方案
someMC.nextFrame();
} while(someMC.currentFrame =< someMC.totalFrames)
有关如何将图像传输到服务器端页面检查: http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php
如果您只有swf文件,您可以尝试在自己的swf中加载它并运行上面的代码。
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
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.
这篇关于如何以编程方式提取Flash帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!