资源简介
最近项目中要显示gif动态图片,偶然中发现一个不错的类PictureEx,显示gif非常的溜。
在博客作了介绍:https://blog.csdn.net/xxm524/article/details/80785856
不过也发现它不支持图片居中、图片按原比例显示能操作,因此做了一些小的修改来支持。
由于网上介绍PictureEx类的文章太多了,这里不再赘述,只介绍图片居中显示和图片铺满控件的修改。
代码片段和文件信息
// 004_PictureExDemo.cpp : Defines the class behaviors for the application.
//
#include “stdafx.h“
#include “004_PictureExDemo.h“
#include “004_PictureExDemoDlg.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CMy004_PictureExDemoApp
BEGIN_MESSAGE_MAP(CMy004_PictureExDemoApp CWinApp)
ON_COMMAND(ID_HELP &CWinApp::onhelp)
END_MESSAGE_MAP()
// CMy004_PictureExDemoApp construction
CMy004_PictureExDemoApp::CMy004_PictureExDemoApp()
{
// support Restart Manager
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
// TODO: add construction code here
// Place all significant initialization in InitInstance
}
// The one and only CMy004_PictureExDemoApp object
CMy004_PictureExDemoApp theApp;
// CMy004_PictureExDemoApp initialization
BOOL CMy004_PictureExDemoApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
AfxEnableControlContainer();
// Create the shell manager in case the dialog contains
// any shell tree view or shell list view controls.
CShellManager *pShellManager = new CShellManager;
// Activate “Windows Native“ visual manager for enabling themes in MFC controls
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable you should remove from the following
// the specific initialization routines you do not need
// Change the registry key under which our settings are stored
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization
SetRegistryKey(_T(“Local AppWizard-Generated Applications“));
CMy004_PictureExDemoDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
else if (nResponse == -1)
{
TRACE(traceAppMsg 0 “Warning: dialog creation failed so application is terminating unexpectedly.\n“);
TRACE(traceAppMsg 0 “Warning: if you are using MFC controls on the dialog you cannot #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS.\n“);
}
// Delete the shell manager created above.
if (pShellManager != NULL)
{
delete pShellManager;
}
#ifndef _AFXDLL
ControlBarCleanUp();
#endif
// Since the dialog has been clos
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-06-23 18:25 004_PictureExDemo\
目录 0 2018-06-23 16:15 004_PictureExDemo\.vs\
目录 0 2018-06-23 16:15 004_PictureExDemo\.vs\004_PictureExDemo\
目录 0 2018-06-23 16:15 004_PictureExDemo\.vs\004_PictureExDemo\v14\
文件 52736 2018-06-23 18:25 004_PictureExDemo\.vs\004_PictureExDemo\v14\.suo
目录 0 2018-06-23 18:25 004_PictureExDemo\004_PictureExDemo\
文件 3128 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo\004_PictureExDemo.cpp
文件 579 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo\004_PictureExDemo.h
文件 14146 2018-06-23 18:00 004_PictureExDemo\004_PictureExDemo\004_PictureExDemo.rc
文件 10969 2018-06-23 18:22 004_PictureExDemo\004_PictureExDemo\004_PictureExDemo.vcxproj
文件 2541 2018-06-23 16:19 004_PictureExDemo\004_PictureExDemo\004_PictureExDemo.vcxproj.filters
文件 632 2018-06-23 18:15 004_PictureExDemo\004_PictureExDemo\004_PictureExDemo.vcxproj.user
文件 5053 2018-06-23 18:03 004_PictureExDemo\004_PictureExDemo\004_PictureExDemoDlg.cpp
文件 954 2018-06-23 18:02 004_PictureExDemo\004_PictureExDemo\004_PictureExDemoDlg.h
文件 34745 2018-06-23 18:08 004_PictureExDemo\004_PictureExDemo\PictureEx.cpp
文件 10681 2018-06-23 18:04 004_PictureExDemo\004_PictureExDemo\PictureEx.h
文件 5756 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo\ReadMe.txt
目录 0 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo\res\
文件 67777 2015-09-20 17:20 004_PictureExDemo\004_PictureExDemo\res\004_PictureExDemo.ico
文件 822 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo\res\My004_PictureExDemo.rc2
文件 2022 2018-06-23 18:00 004_PictureExDemo\004_PictureExDemo\resource.h
文件 219 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo\stdafx.cpp
文件 1753 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo\stdafx.h
文件 314 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo\targetver.h
文件 1939 2018-06-23 18:13 004_PictureExDemo\004_PictureExDemo\TestDlg.cpp
文件 572 2018-06-23 16:24 004_PictureExDemo\004_PictureExDemo\TestDlg.h
文件 1333 2018-06-23 16:15 004_PictureExDemo\004_PictureExDemo.sln
目录 0 2018-06-23 18:25 004_PictureExDemo\bin\
文件 3574784 2018-06-23 18:22 004_PictureExDemo\bin\004_PictureExDemo.exe
文件 4271315 2018-06-23 15:30 004_PictureExDemo\bin\1.gif
文件 172294 2018-06-23 16:05 004_PictureExDemo\bin\1.jpg
............此处省略0个文件信息
- 上一篇:微信小程序反编译工具-wxappUnpacker
- 下一篇:电力系统过电压 谢广润
评论
共有 条评论