fillsolidrect_onerasebkgnd 重影_bitblt函数(5)

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

}

else

{ // gripper at top

rcGrip.top -= m_cyGripper + 1;

rcGrip.bottom = rcGrip.top + 11;

rcGrip.right = rcBtn.left - 3;

}

rcGrip.InflateRect(bHorz ? 1 : 0, bHorz ? 0 : 1);

// draw the caption background

//CBrush br;

COLORREF clrCptn = m_bActive ?

::GetSysColor(COLOR_ACTIVECAPTION) :

::GetSysColor(COLOR_INACTIVECAPTION);

// query gradient info (usually TRUE for Win98/Win2k)

BOOL bGradient = FALSE;

::SystemParametersInfo(SPI_GETGRADIENTCAPTIONS, 0, &bGradient, 0);

if (!bGradient)

pDC->FillSolidRect(&rcGrip, clrCptn); // solid color

else

{

// gradient from left to right or from bottom to top

// get second gradient color (the right end)

COLORREF clrCptnRight = m_bActive ?

::GetSysColor(COLOR_GRADIENTACTIVECAPTION) :

::GetSysColor(COLOR_GRADIENTINACTIVECAPTION);

// this will make 2^6 = 64 fountain steps

int nShift = 6;

int nSteps = 1 << nShift;

for (int i = 0; i < nSteps; i++)

{

// do a little alpha blending

int nR = (GetRValue(clrCptn) * (nSteps - i) +

GetRValue(clrCptnRight) * i) >> nShift;

int nG = (GetGValue(clrCptn) * (nSteps - i) +

GetGValue(clrCptnRight) * i) >> nShift;

int nB = (GetBValue(clrCptn) * (nSteps - i) +

GetBValue(clrCptnRight) * i) >> nShift;

COLORREF cr = RGB(nR, nG, nB);

// then paint with the resulting color

CRect r2 = rcGrip;

if (bHorz)

{

r2.bottom = rcGrip.bottom -

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

r2.top = rcGrip.bottom -

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

if (r2.Height() > 0)

pDC->FillSolidRect(r2, cr);


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

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

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