問題描述
我希望能夠獲取 1 幀 SWF 文件并通過 PHP 將其轉換為 PNG.我可以使用命令行工具來完成這項工作.
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.
我該怎么做呢?我找到了 一個 ActiveX 庫,但這似乎層數太多了.我還看到 Gnash 似乎有一個 PNG 輸出類,但我想不通了解如何在不進行一些我自己的深度編碼的情況下從命令行獲得它.還有其他聰明的解決方案嗎?謝謝!
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!
澄清一下,這不是我只想做一次的一次性任務.我希望能夠讓 PHP 腳本根據命令執行此任務.謝謝!
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!
另一個還有一個澄清.這不是用戶在 Flash 中進行繪圖的情況.我正在下載原始 1 幀 SWF 文件,并希望保存 PNG 副本以減少下載時間.這樣的任務可行嗎?再次感謝!
Another 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!
推薦答案
您可以使用 swftools.swfrender file.swf -X pixelsize -Y pixelsize -o output.png
如果僅指定了 -X -Y 參數之間的一個,則遵守比例
If only one between -X -Y parameter is specified then proportions are respected
這篇關于將 SWF 轉換為 PNG的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!