下面用 VC6 来写一个 GdiPlus 的 Demo 工程
Step1:新建一个名为 Demo_GdiPlus 的 MFC AppWizard(exe) 工程
操作步骤:
(1)主菜单File->New...,选择 Projects 选项卡;
(2)在工程类型列表中选中 MFC AppWizard(exe);
(3)Project name 填入 Demo_GdiPlus,按 OK 进入下一页;
(4)选择单文档(Single document)类型的程序框架,按 Finish 完成工程创建工作。
Step2:添加头文件声明
在 StdAfx.h 中添加以下代码:
//
{
{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
typedef unsigned long ULONG_PTR, * PULONG_PTR;
#include < gdiplus.h >
using namespace Gdiplus;
#pragma comment (lib, "GdiPlus.lib")
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
typedef unsigned long ULONG_PTR, * PULONG_PTR;
#include < gdiplus.h >
using namespace Gdiplus;
#pragma comment (lib, "GdiPlus.lib")
Step3:在 CDemo_GdiPlusApp 中增加成员变量 m_gdiplusTo

本文档详细介绍了如何在 VC6 下创建一个使用 GdiPlus 的 MFC 应用程序。通过新建 MFC AppWizard(exe) 工程,添加头文件声明,设置成员变量和初始化,实现 GdiPlus 的安装与卸载,以及在 OnDraw() 函数中绘制 GdiPlus 图形,最终完成了一个基础的 GdiPlus Demo 程序。此 Demo 可作为后续深入学习 GdiPlus 的基础。
512

被折叠的 条评论
为什么被折叠?



