标签:wim art token 绘制 family size string catch using
#include <Gdiplus.h>
using namespace Gdiplus;
//声明
Gdiplus::GdiplusStartupInput m_gdiplusStartupInput;
ULONG_PTR m_gdiplusToken;
Image * m_pImage;
//构造
GdiplusStartup(&m_gdiplusToken, &m_gdiplusStartupInput, NULL);
m_pImage= NULL;
CString sPath = _T("images/vk.png");
if (FileExists(sPath))
{
WCHAR buf[128];
wcscpy(buf, CT2CW(sPath));
m_pImage= Image::FromFile(buf);
}
//绘制
Gdiplus::Graphics graphics(dc.GetSafeHdc());
graphics.SetInterpolationMode(InterpolationModeDefault);
graphics.DrawImage(m_pImage, 0, 0, m_rClient.Width(), m_rClient.Height());
//销毁
if (m_pImage)
{
try
{
delete m_pImage;
}
catch (...)
{
}
m_pImage = NULL;
}
GdiplusShutdown(m_gdiplusToken);
标签:wim art token 绘制 family size string catch using
原文地址:http://www.cnblogs.com/waterair/p/6739257.html