swf图像数据的简单提取

本文介绍了如何在VC中使用Flash控件提取SWF文件中的图像数据。通过加载SWF文件、播放、跳帧及调整显示模式,然后利用屏幕抓图技术,结合双缓冲绘图提取图像数据。尽管这种方法在控件被覆盖时可能抓取错误图像,并且对于某些动态AS控制的SWF帧数获取存在困难,但总体提供了有效提取SWF图像的方案。
摘要由CSDN通过智能技术生成
 

       vc中有时会需要提取swf文件中的数据用于处理,由于swf文件要播放的内容会牵涉到as语言,Flash player是一个解释器,它能解析swf文件中的as脚本,所以在vc中,我们很难实现自己去显示swf中的图像。

       这时我们要用到flash控件,这是一个COM组件,在对话框界面右键选择——插入ActiveX控件——选择Shockwave Flash Object,选中这个条目,会显示它的安装路径,如下图:

      

                                   1-1        Flash控件

       这样我们就插入一个flash控件,当我们双击这个条目时,就插入一个Flash控件了。双击flash空间窗口就能创建一个flash控件类,里面都是COM借口函数。声明一个flash控件变量就能使用了,

例如CShockwaveFlash   m_FlashCtl;

1.   加载swf文件:

m_FlashCtl.LoadMovie(0, “1.swf”);

第一个参数:表示图像层数,层数值大的在上面显示;

第二个参数:swf图像的路径,可以是本地的,也可以是一个url。

2.   播放swf文件:

当文件加载以后就可以使用m_FlashCtl.Play(),进行播放了。

3.   跳转到某一帧:

m_FlashCtl.GotoFrame(index);

4.   Flash图像的显示模式:

m_FlashCtl.putScaleMode(2);

2为拉伸图像适应窗口,就是保证不会

SWFTools is a collection of utilities for working with Adobe Flash files (SWF files). The tool collection includes programs for reading SWF files, combining them, and creating them from other content (like images, sound files, videos or sourcecode). SWFTools is released under the GPL. The current collection is comprised of the programs detailed below: • PDF2SWF A PDF to SWF Converter. Generates one frame per page. Enables you to have fully formatted text, including tables, formulas, graphics etc. inside your Flash Movie. It's based on the xpdf PDF parser from Derek B. Noonburg. • SWFCombine A multi-function tool for inserting SWFs into Wrapper SWFs, contatenating SWFs, stacking SWFs or for basic parameter manipulation (e.g. changing size). • SWFStrings Scans SWFs for text data. • SWFDump Prints out various informations about SWFs, like contained images/fonts/sounds, disassembly of contained code as well as cross-reference and bounding box data. • JPEG2SWF Takes one or more JPEG pictures and generates a SWF slideshow from them. Supports motion estimation compression (h.263) for better compression of video sequences. • PNG2SWF Like JPEG2SWF, only for PNGs. • GIF2SWF Converts GIFs to SWF. Also able to handle animated gifs. • WAV2SWF Converts WAV audio files to SWFs, using the L.A.M.E. MP3 encoder library. • AVI2SWF Converts AVI animation files to SWF. It supports Flash MX H.263 compression. Some examples can be found at examples.html. (Notice: this tool is not included anymore in the latest version, as ffmpeg or mencoder do a better job nowadays) • Font2SWF Converts font files (TTF, Type1) to SWF. • SWFBBox Allows to read out, optimize and readjust SWF bounding boxes. • SWFC A tool for creating SWF files from simple script files. Includes support for both ActionScript 2.0 as well as ActionScript 3.0. • SWFExtract Allows to extract Movieclips, Sounds, Images etc. from SWF files. • AS3Compile A standalone ActionScript 3.0 compiler. Mostly compatible with Flex. SWFTools
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值