fillsolidrect_onerasebkgnd 重影_bitblt函数(6)

电脑杂谈  发布时间:2017-03-10 14:21:13  来源:网络整理

}

else

{

r2.left = rcGrip.left +

((i * rcGrip.Width()) >> nShift);

r2.right = rcGrip.left +

(((i + 1) * rcGrip.Width()) >> nShift);

if (r2.Width() > 0)

pDC->FillSolidRect(r2, cr);

}

}

}

// draw the caption text - first select a font

CFont font;

int ppi = pDC->GetDeviceCaps(LOGPIXELSX);

int pointsize = MulDiv(96, 96, ppi); // 8.5 points at 96 ppi

LOGFONT lf;

BOOL bFont = font.CreatePointFont(pointsize, m_sFontFace);

if (bFont)

{

// get the text color

COLORREF clrCptnText = m_bActive ?

::GetSysColor(COLOR_CAPTIONTEXT) :

::GetSysColor(COLOR_INACTIVECAPTIONTEXT);

int nOldBkMode = pDC->SetBkMode(TRANSPARENT);

COLORREF clrOldText = pDC->SetTextColor(clrCptnText);

if (bHorz)

{

// rotate text 90 degrees CCW if horizontally docked

font.GetLogFont(&lf);

font.DeleteObject();

lf.lfEscapement = 900;

font.CreateFontIndirect(&lf);

}

CFont* pOldFont = pDC->SelectObject(&font);

CString sTitle;

GetWindowText(sTitle);

CPoint ptOrg = bHorz ?

CPoint(rcGrip.left - 1, rcGrip.bottom - 3) :

CPoint(rcGrip.left + 3, rcGrip.top - 1);

pDC->ExtTextOut(ptOrg.x, ptOrg.y,

ETO_CLIPPED, rcGrip, sTitle, NULL);

pDC->SelectObject(pOldFont);

pDC->SetBkMode(nOldBkMode);

pDC->SetTextColor(clrOldText);

}

// draw the button

m_biHide.Paint(pDC);

#endif

}

UINT CCoolBar::OnNcHitTest(CPoint point)

{

CRect rcBar;

GetWindowRect(rcBar);

UINT nRet = baseCCoolBar::OnNcHitTest(point);

if (nRet != HTCLIENT)

return nRet;

CRect rc = m_biHide.GetRect();

rc.OffsetRect(rcBar.TopLeft());


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-36846-6.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 知业
      知业

      那块地丢了就等于把极其重要的战略要塞拱手让给战略对手

    热点图片
    拼命载入中...