Windows 下批量生成 SWF 缩略图的快速解决方案

临时博客,还未整理,只是用来记录一些资料,后面还会进行整理

因为单位的机器是 Windwos 2000 的,很多仅支持 Windows XP/Vista 的工具就都用不了了;ffmpeg 功能很多很强大,但对我手里这些 SWF 似乎没什么办法;MediaCoder(mencoder)倒是能认出 SWF 中的音频来,但也只能认出音频来,还是在我用 flasm 解压缩原 SWF 文件之后……

溜溜找了一天,第二天才发现了 SWF To Image Library,一个 Freeware ActiveX Library,解除了操作系统问题、还捎带手避免了法律问题。这玩意儿安装极其迅速,也就是拷贝点文件,注册下 DLL。安装目录下的 Examples 文件夹中直接提供了帮助文件里提到 的 VBScript 脚本,简单修改一下就能用了。

如下,简单的几个步骤就可以批量生成 SWF 缩略图:

  1. 下载安装 SWF To Image Library(http://www.bestfreewaredownload.com/freeware/t-free-swf-to-image-freeware-klnkewiv.html);
  2. “开始”->“程序”->“SWF To Image”->“Examples”;
  3. 选中“Convert all SWFs to JPG.vbs”,“复制到” SWFs 所在的文件夹;
  4. 转到 SWFs 所在文件夹,右键单击“Convert all SWFs to JPG.vbs”,选择“以命令提示打开”,稍候,搞定!

当然,你也可以参考示例文件编写符合自己要求的脚本,比如通过 SWFToImage.ImageWidth 和 SWFToImage.ImageHeight 指定生成图片的宽高等等,详细信息可以(必须)参考帮助文件。理论上讲,这个 ActiveX 库无论是 VBScript 这类脚本语言还是 .NET 支持的各种语言都可以调用,不过先把手头的活儿干完了再探索吧……

本人已将该资源上传到 CSDN 下载频道(http://download.csdn.net/source/705742),任君取用




How to run and use SWF To Image on x64 Windows

作者:佚名 字体:[增加 减小] 来源:互联网 时间:08-06 14:34:28 我要评论

The SWF To Image ActiveX library is made using managed Windows 32-bit code so as a result library (dll) can not be loaded into 64-bit application
The SWF To Image ActiveX library is made using managed Windows 32-bit code so as a result library (dll) can not be loaded into 64-bit application.
Solution is to build application for x86 platform so application will be operate in 32-bit mode (will work on both 32 and 64-bit OS)

To apply this in Visual Studio 2005 and higher:

- open project in Visual Studio 2005
- open project settings by pressing ALT+F7 (or via main menu: Project | Windows Application 1 Properties)
- select "Build" tab
- change "Platform Target" to "x86" option
- re-build project

Produced EXE application will work OK with registration-free scenario on Windows x64. To see how to add registration-free support into application see below:

For registration-free usage scenario for SWF To Image please use the following manifest file:

Content of YourApplication.exe.manifest file:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

<file name="SWFToImage.dll">
<typelib tlbid="{F52B2898-3CD9-4530-8F1E-2762A2783C33}" version="1.0" helpdir="C:\WINDOWS\system32\"/>
<comClass description="CLASS_SWFToImage" clsid="{479A1AAC-C148-40BB-9868-A9773DA66AF9}" progid="SWFToImage.SWFToImageObject" threadingModel="both" tlbid="{F52B2898-3CD9-4530-8F1E-2762A2783C33}" />
</file>
</assembly>

Do not forget to put SWFToImage.dll into the same folder where YourApplication.exe is located





Convert SWF movie to Image [.jpg, .gif, .png, .bmp]

arinhere, 15 Jan 2008
Rate this:  
Convert your swf movie file to image

Introduction

This piece of code will help you to generate images from your flash movie files[.swf].

Background

Sometime it's very important to get the screen shot of the first frame of .swf files. These things needs mostly whenever you work with ActiveX component like flash with ASP.Net. This program will extract the very first frame of the flash movie file and will save it as popular image formats like .jpg, .gif, .png, .bmp on the fly.

Using the code

Using the code is very simple but before that you have to setup some basic things. In this application I have used Interop.SWFToImage.dll to convert the swf files.

So at first download SWFToImage.exe from http://www.bytescout.com . This is a free product. Just download it and install the .exe file.

Your set up is ready to execute the application. Now add a reference of the Interop dll. The dll will be found within the installation directory, in the "Redistributable" folder.

Now import the SWFToImage class and create an object of it. Rest is easy. Here are some important code snippet.

swfobj.InputSWFFileName = FileUpload1.PostedFile.FileName
swfobj.ImageOutputType = TImageOutputType.iotJPG
swfobj.Execute()
swfobj.SaveToFile(Server.MapPath("dumps/images/" & filenm))        

Here swfobject is the object of the SWFToImage class. The property ImageOutputType receives the format of the converted image[.jpg, .gif, .png, .bmp].

According to the folder structure the uploaded files will be stored in the "dumps/swf" and the converted images will be stored in the "dump/images" folder.








Convert SWF movie to Image [.jpg, .gif, .png, .bmp]

arinhere, 15 Jan 2008
Rate this:  
Convert your swf movie file to image

Introduction

This piece of code will help you to generate images from your flash movie files[.swf].

Background

Sometime it's very important to get the screen shot of the first frame of .swf files. These things needs mostly whenever you work with ActiveX component like flash with ASP.Net. This program will extract the very first frame of the flash movie file and will save it as popular image formats like .jpg, .gif, .png, .bmp on the fly.

Using the code

Using the code is very simple but before that you have to setup some basic things. In this application I have used Interop.SWFToImage.dll to convert the swf files.

So at first download SWFToImage.exe from http://www.bytescout.com . This is a free product. Just download it and install the .exe file.

Your set up is ready to execute the application. Now add a reference of the Interop dll. The dll will be found within the installation directory, in the "Redistributable" folder.

Now import the SWFToImage class and create an object of it. Rest is easy. Here are some important code snippet.

swfobj.InputSWFFileName = FileUpload1.PostedFile.FileName
swfobj.ImageOutputType = TImageOutputType.iotJPG
swfobj.Execute()
swfobj.SaveToFile(Server.MapPath("dumps/images/" & filenm))        

Here swfobject is the object of the SWFToImage class. The property ImageOutputType receives the format of the converted image[.jpg, .gif, .png, .bmp].

According to the folder structure the uploaded files will be stored in the "dumps/swf" and the converted images will be stored in the "dump/images" folder.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值