MFC小程序问题,TextOut(x,y,str)
voidCScreenFineView::OnDraw(CDC*pDC){CScreenFineDoc*pDoc=GetDocument();ASSERT_VALID(p...
void CScreenFineView::OnDraw(CDC* pDC)
{
CScreenFineDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CWindowDC dc(NULL);
CFont newFont;
newFont.CreateFont(
400,
40,
0,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
DEFAULT_CHARSET,OUT_DEVICE_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH,"华文新魏"
);
CFont * oldFont = dc.SelectObject (&newFont);
dc.SetTextColor(RGB(255,105,255));
dc.SetBkMode(TRANSPARENT);
// dc.TextOut(200,180,"JHJH");
dc.SelectObject(oldFont);
// pDC->TextOut(500,200,"JHJHJH");
}在这段程序中为什么 dc.TextOut(200,180,"JHJH");可以显示出字体的效果,而不用这个用pDC->TextOut(500,200,"JHJHJH"); 就不能显示出字体的效果呢? 展开
{
CScreenFineDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CWindowDC dc(NULL);
CFont newFont;
newFont.CreateFont(
400,
40,
0,
0,
FW_NORMAL,
FALSE,
FALSE,
0,
DEFAULT_CHARSET,OUT_DEVICE_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
DEFAULT_PITCH,"华文新魏"
);
CFont * oldFont = dc.SelectObject (&newFont);
dc.SetTextColor(RGB(255,105,255));
dc.SetBkMode(TRANSPARENT);
// dc.TextOut(200,180,"JHJH");
dc.SelectObject(oldFont);
// pDC->TextOut(500,200,"JHJHJH");
}在这段程序中为什么 dc.TextOut(200,180,"JHJH");可以显示出字体的效果,而不用这个用pDC->TextOut(500,200,"JHJHJH"); 就不能显示出字体的效果呢? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询