MFC上显示GIF图片(使用 GIF Animation Control控件)

http://blog.csdn.net/silence1214/article/details/5987877(原文)

昨晚到现在一直寻思着在MFC的Dialog上显示个GIF图片,无奈如此的有难度,经过寻找找到个好用的控件,拿来用了,但是官网给的不是很好使。也缺乏一个文件,我这里一起整理出来了。说个过程

1:一共需要5个文件,其中3个h,2个cpp文件,如图

下载地址我随后补充上来。

 

2:分别导入到自己的工程,接下来才是操作

3:在自己的Dlg的资源设计上,添加一个static的静态文本框,然后给这个文本框赋予id卫IDC_GIF_ANIMATION,然后右键点击这个文本框找到-》建立类向导-》成员变量-》在下面找到“IDC_GIF_ANIMATION”,双击-》变量名字输入“m_Animation”,目录选择“Control”,类型选择CStatic。

4:在Dlg的h中找到CStatic m_Animation,修改成 CGifAnimation m_Animation;,并且在这个h中添加#include "GifAnimation.h"

5:在Dlg的cpp中初始化函数中添加: 

m_Animation.LoadAnimatedGif("./res/1.gif");
m_Animation.Play();

 

6:编译即可。

 

这里有一个官网的说明,也差不多

http://www.codeproject.com/KB/static/gifanimation.aspx

 

下载资源的地址:

http://www.codeproject.com/KB/static/gifanimation/AnimationGif_src.zip

http://www.codeproject.com/KB/static/gifanimation/AnimationGif_demo.zip
 
 

问题1:

刚刚在VS2010里面使用vc6.0的那种#include <fstream.h>方式,但是编译时提示fatal error C1083: 无法打开包括文件:“fstream.h”: No such file or directory。

查阅了相关资料后,找到解决方法: 

#include <fstream.h>

 

改成

#include <fstream> using namespace std;

问题2:ifstream 的 open 函数中不能用 ios::nocreate 属性。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Animation GIF ActiveX is a 32bit OLE Control Module to display GIF file(still and animation, GIF87a and GIF89a) in OLE Container. It supports all GIF89a standard, including transparent, animation, looping, delay time, logical screen, restoring to background, etc. It also supports Netscape GIF extension. Animation GIF ActiveX 2.0 has many new features including AutoSize, Stretch, custom playing sequence (reverse, pingpong or user-defined), etc. You can bind the GIF property in version 2.0 to database in your application. Version 2.0 has no flickering when displaying large GIF files in transparent or opaque mode. Version 2.0 can recover the correct frames in the damaged GIF file. Version 2.0 is made in ATL, so you don't need any additional DLL when using the ActiveX. Animation GIF ActiveX supports most popular development platforms including VB, VC++, VFP, VBA, Access, Delphi, etc. Animation GIF ActiveX is shareware. If you are using an unregistered version, please see Registration to get information about how to register. Important notes for 1.x users: Because 2.0 is made in ATL, it's very different from version 1.x. The properties, methods, calling interfaces and CLSIDs are changed. So the applications using 1.x should be redesigned for Animation GIF ActiveX 2.0. If you have any questions, please send E-mail to jinhui@jcomsoft.com Please visit my home page http://www.jcomsoft.com to get the newest version, news and more great and FREE ActiveX. Now you can register your copy online via world wide web.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值