急!!CImageDC设置字体无效,,
微软最新的MSDN文档找不到CImageDC类的相关文档,google搜索CImageDC也找不到相关的,
看我的代码哪里不对了?反正字体就是没变化!!
image.Load(file); }
if (FAILED(hResult)) {
//AfxMessageBox("调用图像文件失败!");
return FALSE;
}
CImageDC imageDC(image);
SetTextColor(imageDC, RGB(30, 30, 30) );//设置颜色
CFont font;
CFont *pOldFont = NULL;
font.CreatePointFont(100, _T("Comic Sans MS"));
pOldFont = (CFont *)SelectObject(imageDC, &font); //设置字体TextOut(imageDC, x, y, str.GetBuffer(0), str.GetLength());
SelectObject(imageDC, pOldFont);
image.Save(file, Gdiplus::ImageFormatJPEG);