首页 > 代码库 > MFC之GDI+配置篇

MFC之GDI+配置篇

1.环境配置

填gdiplus.lib

2.头文件

#include <GdiPlus.h>using namespace Gdiplus;

3.初始

static ULONG_PTR m_gdiplusToken;
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);

4.画

CClientDC *pDC = new CClientDC(GetDlgItem(IDC_PicBox));
pDC->SetStretchBltMode(HALFTONE);
Graphics graphics(pDC->m_hDC);
graphics.Clear(Color(255,255,0,0));
graphics.DrawImage(pMask, 0, 0,pMask->GetWidth(), pMask->GetHeight());
delete pDC;

5.可选

delete以下代码

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


MFC之GDI+配置篇