1. GDI+初始化
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PRT gdiplusToke;
Gdiplus::GdiplusStartup(&gdiplusStartupInput, &gdiplusToken, NULL);
2. 打开图片
Gdiplus::Image image(“filepath”);
if(image.GetLastStatus() != Gdiplus::Ok){
error(1);
}
3.创建兼容DC
Gdiplus::Graphics graphics(hDC);
graphics.DrawImage(&image, 0, 0, RectWidth(lprcBmp),RectWidth(lprcBmp));
4.卸载GDI+
graphics.ReleaseDC(NULL);