资源简介
动态加载GIF动画 VC 实现
include "stdafx.h"
#include "TransparentGif.h"
#include "TransparentGifDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CTransparentGifApp
BEGIN_MESSAGE_MAP(CTransparentGifApp, CWinAppEx)
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()
// CTransparentGifApp 构造
CTransparentGifApp::CTransparentGifApp()
{
// TODO: 在此处添加构造代码,
// 将所有重要的初始化放置在 InitInstance 中
}
// 唯一的一个 CTransparentGifApp 对象
CTransparentGifApp theApp;
// CTransparentGifApp 初始化
BOOL CTransparentGifApp::InitInstance()
{
// 如果一个运行在 Windows XP 上的应用程序清单指定要
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 将它设置为包括所有要在应用程序中使用的
// 公共控件类。
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinAppEx::InitInstance();
AfxEnableControlContainer();
// 标准初始化
// 如果未使用这些功能并希望减小
// 最终可执行文件的大小,则应移除下列
// 不需要的特定初始化例程
// 更改用于存储设置的注册表项
// TODO: 应适当修改该字符串,
// 例如修改为公司或组织名
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
CTransparentGifDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: 在此放置处理何时用
// “确定”来关闭对话框的代码
}
else if (nResponse == IDCANCEL)
{
// TODO: 在此放置处理何时用
// “取消”来关闭对话框的代码
}
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
// 而不是启动应用程序的消息泵。
return FALSE;
}
![](http://www.nz998.com/pic/40768.jpg)
代码片段和文件信息
//////////////////////////////////////////////////////////////////////
// PictureEx.cpp: implementation of the CPictureEx class.
//
// Picture displaying control with support for the following formats:
// GIF (including animated GIF87a and GIF89a) JPEG BMP WMF ICO CUR
//
// Written by Oleg Bykov (oleg_bykoff@rsdn.ru)
// Copyright (c) 2001
//
// To use CPictureEx follow these steps:
// - place a static control on your dialog (either a text or a bitmap)
// - change its identifier to something else (e.g. IDC_MYPIC)
// - associate a CStatic with it using ClassWizard
// - in your dialog‘s header file replace CStatic with CPictureEx
// (don‘t forget to #include “PictureEx.h“ and add
// PictureEx.h and PictureEx.cpp to your project)
// - call one of the overloaded CPictureEx::Load() functions somewhere
// (OnInitDialog is a good place to start)
// - if the preceding Load() succeeded call Draw()
//
// You can also add the control by defining a member variable of type
// CPictureEx calling CPictureEx::Create (derived from CStatic) then
// CPictureEx::Load and CPictureEx::Draw.
//
// By default the control initializes its background to COLOR_3DFACE
// (see CPictureEx::PrepareDC()). You can change the background by
// calling CPictureEx::SetBkColor(COLORREF) after CPictureEx::Load().
//
// I decided to leave in the class the functions to write separate frames from
// animated GIF to disk. If you want to use them uncomment #define GIF_TRACING
// and an appropriate section in CPictureEx::Load(HGLOBAL DWORD). These functions
// won‘t be compiled and linked to your project unless you uncomment #define GIF_TRACING
// so you don‘t have to worry.
//
// Warning: this code hasn‘t been subject to a heavy testing so
// use it on your own risk. The author accepts no liability for the
// possible damage caused by this code.
//
// Version 1.0 7 Aug 2001
// Initial release
//
// Version 1.1 6 Sept 2001
// ATL version of the class
//
// Version 1.2 14 Oct 2001
// - Fixed a problem with loading GIFs from resources
// in MFC-version of the class for multi-modules apps.
// Thanks to Ruben Avila-Carretero for finding this out.
//
// - Got rid of waitable timer in ThreadAnimation()
// Now CPictureEx[Wnd] works in Win95 too.
// Thanks to Alex Egiazarov and Wayne King for the idea.
//
// - Fixed a visual glitch of using SetBkColor.
// Thanks to Kwangjin Lee for finding this out.
//
// Version 1.3 10 Nov 2001
// - Fixed a DC leak. One DC leaked per each UnLoad()
// (forgot to put a ReleaseDC() in the end of
// CPictureExWnd::PrepareDC() function).
//
// - Now it is possible to set a clipping rectangle using
// CPictureEx[Wnd]::SetPaintRect(const LPRECT) functio
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 707072 2012-12-04 09:22 加载Gif VC++\Release\TransparentGif.exe
文件 36373 2012-06-06 21:14 加载Gif VC++\TransparentGif\PictureEx.cpp
文件 10851 2012-06-06 16:26 加载Gif VC++\TransparentGif\PictureEx.h
文件 2863 2012-12-04 08:31 加载Gif VC++\TransparentGif\ReadMe.txt
文件 307012 2009-04-27 14:01 加载Gif VC++\TransparentGif\res\l_0f2e2f10840ee8ce543c3a33148dad5d.gif
..A.SH. 5632 2012-12-04 08:48 加载Gif VC++\TransparentGif\res\Thumbs.db
文件 67777 2007-11-28 16:21 加载Gif VC++\TransparentGif\res\TransparentGif.ico
文件 370 2012-12-04 08:31 加载Gif VC++\TransparentGif\res\TransparentGif.rc2
文件 593 2012-12-04 08:52 加载Gif VC++\TransparentGif\resource.h
文件 147 2012-12-04 08:31 加载Gif VC++\TransparentGif\stdafx.cpp
文件 1879 2012-12-04 09:22 加载Gif VC++\TransparentGif\stdafx.h
文件 1030 2012-12-04 08:31 加载Gif VC++\TransparentGif\targetver.h
文件 1757 2012-12-04 08:31 加载Gif VC++\TransparentGif\TransparentGif.cpp
文件 493 2012-12-04 08:31 加载Gif VC++\TransparentGif\TransparentGif.h
文件 4872 2012-12-04 09:15 加载Gif VC++\TransparentGif\TransparentGif.rc
文件 5702 2012-12-04 09:22 加载Gif VC++\TransparentGif\TransparentGif.vcproj
文件 1409 2012-12-04 09:23 加载Gif VC++\TransparentGif\TransparentGif.vcproj.ZHL-PC.Administrator.user
文件 3832 2012-12-04 09:12 加载Gif VC++\TransparentGif\TransparentGifDlg.cpp
文件 752 2012-12-04 09:10 加载Gif VC++\TransparentGif\TransparentGifDlg.h
文件 908 2012-12-04 08:31 加载Gif VC++\TransparentGif.sln
..A..H. 11264 2012-12-04 09:23 加载Gif VC++\TransparentGif.suo
目录 0 2014-02-03 17:01 加载Gif VC++\TransparentGif\res
目录 0 2014-02-03 17:01 加载Gif VC++\Release
目录 0 2014-02-03 17:01 加载Gif VC++\TransparentGif
目录 0 2014-02-03 17:01 加载Gif VC++
----------- --------- ---------- ----- ----
1172588 25
- 上一篇:c语言直接读写xls文件,无需安装office
- 下一篇:C语言库函数源代码大全
相关资源
- VC++ 多线程文件读写操作
- 移木块游戏,可以自编自玩,vc6.0编写
- MFC数字钟(基于VC6.0)
- 安科瑞智能电能表MODBUS通讯程序 VC6
- VC++MFC小游戏实例教程(实例)+MFC类库
- VC6LineNumberAddin.dll
- 用VC6.0实现多边形扫描线填充算法
- VC++实现CMD命令执行与获得返回信息
- VC助手 VC6.0助手
- VC++基于OpenGL模拟的一个3维空间模型
- 基于VC++的SolidWorks二次开发SolidWorks
- VC6 USB开发源码
- VC操作SQLSERVER数据库
- aes加解密(vc源程序)
- vc_串口通讯
- 吕鑫vc6c++数据结构视频源码
- 派克变换VC++源码(附文档)
- 基于opencv漫水填充算法综合
- VC++ 串口
- VC++ 大富翁4_大富翁游戏源码
- MFC的异步网络通讯应用程序
- VC++ 摄像头视频采集与回放源程序
- 转 VC++ 实现电子邮件(Email)发送
- 基于MFC的VC++仿QQ浏览器源码(雏形)
- VC++ 服务程序编写及安装与卸载
- VC++6.0番茄西红柿VAXvirsual assist X完美破
- VC编程助手2010破解版(原名VA_X_10.6.
- 基于改进的fcm算法的图像分割vc++
- VC++6.0 绿色版,免安装,非常好用。
- Microsoft Visual C++ 2005 Redistributable Pack
评论
共有 条评论