Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
406 views
in Technique[技术] by (71.8m points)

php - Convert SWF to 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.

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...