MFC 显示字体问题,你看那个汉字怎么那么显示啊。。。
CRect rc;
GetClientRect(rc);
CDC* dc=GetDC();
CString str(_T( "abc大小"));
dc->SetBkMode(TRANSPARENT);
dc->SetTextColor(RGB(0,0,255));
CFont font;
LOGFONT lf;
memset(&lf,0,sizeof(LOGFONT));
lf.lfHeight = -14;
lf.lfWeight = FW_NORMAL;
lf.lfClipPrecision = CLIP_LH_ANGLES;
lstrcpy(lf.lfFaceName, L"@宋体");
lf.lfEscapement = 900;
font.CreateFontIndirect(&lf);
CFont *pOldFont = dc->SelectObject(&font);
//for(int i=0;i<;i++)
dc->TextOut(rc.right/2, rc.bottom/2,str);
dc->SelectObject(pOldFont);
font.DeleteObject();
//上面是代码。。。怎么搞,才能达到效果 展开
CRect rc;
GetClientRect(&rc);
CDC* dc=GetDC();
CString str(_T( "abc大小"));
dc->SetBkMode(TRANSPARENT);
dc->SetTextColor(RGB(0,0,255));
CFont font;
LOGFONT lf;
memset(&lf,0,sizeof(LOGFONT));
lf.lfHeight = -14;
lf.lfWeight = FW_NORMAL;
lf.lfClipPrecision = CLIP_LH_ANGLES;
lstrcpy(lf.lfFaceName, _T("宋体"));
lf.lfEscapement = 900;
font.CreateFontIndirect(&lf);
CFont *pOldFont = dc->SelectObject(&font);
//for(int i=0;i<;i++)
dc->TextOut(rc.right/2, rc.bottom/2,str);
dc->SelectObject(pOldFont);
font.DeleteObject();
运行时下面效果:不知道是不是这个意思,你的代码是对的呀
lf.lfEscapement = 900;// 改变这行代码,就可以改变旋转的角度。