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
时间: 2024-10-27 08:49:18