将SWF转换为PNG [英] Convert SWF to PNG

查看:1513
本文介绍了将SWF转换为PNG的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够将1个框架的SWF文件通过PHP转换为PNG。我可以使用命令行工具来完成这项工作。



我怎么能这样做呢?我找到了一个ActiveX库,但看起来像是一个太多的图层。我也看到,Gnash似乎有一个 PNG输出类,但我不能如何从命令行得到这些信息,而不需要对自己的代码进行深层次的编码。有没有其他聪明的解决方案?谢谢!



编辑:为了澄清,这不是我只想做一次的一次性任务。我希望能够有一个PHP脚本执行这个任务的命令。谢谢!



另一个编辑:一个更多的澄清。这不是一个用户在Flash中进行绘图的情况。我正在下载原始的1帧SWF文件,并且想要保存PNG副本以减少下载时间。这样的任务可能吗?再次感谢!

解决方案

您可以使用 swftools
swfrender file.swf -X pixelsize -Y pixelsize -o output.png



如果只有一个-X -Y参数被指定,然后比例被尊重

I'd like to be able to take a 1-frame SWF file and convert it to PNG through PHP. I'm okay with using command-line tools to get this done.

How could I go about doing this? I found an ActiveX library, but that seems like one too many layers. I also see that Gnash seems to have a PNG output class, but I can't figure out how to get to that from the command line without doing some deep coding of my own. Are there any other clever solutions available? Thanks!

EDIT: To clarify, this is not a one-time task I just want to be able to do once. I'd like to be able to have a PHP script perform this task on command. Thanks!

Another EDIT: One more clarification. This is not a situation in which, say, a user makes a drawing in Flash. I am downloading raw 1-frame SWF files, and want to save PNG copies in order to reduce download time. Is such a task possible? Thanks again!

解决方案

you can use swftools.
swfrender file.swf -X pixelsize -Y pixelsize -o output.png

If only one between -X -Y parameter is specified then proportions are respected

这篇关于将SWF转换为PNG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆