本文整理汇总了C++中CPaintDC::ExtTextOut方法的典型用法代码示例。如果您正苦于以下问题:C++ CPaintDC::ExtTextOut方法的具体用法?C++ CPaintDC::ExtTextOut怎么用?C++ CPaintDC::ExtTextOut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPaintDC
的用法示例。
在下文中一共展示了CPaintDC::ExtTextOut方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
void CChildView::OnPaint()
{
CPaintDC *dc;
CDC *pdc;
CRgn ur;
ur.CreateRectRgn(0, 0, 0, 0);
GetUpdateRgn(&ur);
CRect cr;
GetClientRect(&cr);
if (theApp.m_bStarted && !theApp.m_map.IsEmpty()) {
// pdc = &dc;
m_MemDC.SelectClipRgn(&ur);
pdc = &m_MemDC;
theApp.m_map.DrawMap(*pdc, &cr, &ur);
CRect r;
// r = cr;
ur.GetRgnBox(r);
// r.InflateRect(1, 1);
if (r.left < 0)
r.left = 0;
if (r.top < 0)
r.top = 0;
dc = new CPaintDC(this); // device context for painting
dc->BitBlt(r.left, r.top, r.Width(), r.Height(), &m_MemDC, r.left, r.top, SRCCOPY);
}
else {
dc = new CPaintDC(this); // device context for painting
if (theApp.m_bStarted) {
dc->SetTextAlign(TA_CENTER);
CPoint cp = cr.CenterPoint();
CString s;
s.Format("There are no maps in '%s'", theApp.m_map.m_sMapsPath);
dc->ExtTextOut(cp.x, cp.y - dc->GetOutputTextExtent("W").cy/2, ETO_OPAQUE, &cr, s, NULL);
}
else {
dc->FillSolidRect(cr, 0);
}
}
delete dc;
}