void CXTPPopupThemeMSN::DrawBackground(CDC* pDC, CXTPPopupControl* pControl, CRect rcClient) { if (pControl->GetBackgroundBitmap() > 0) { CXTPPopupPaintManager::DrawBackground(pDC, pControl, rcClient); return; } pDC->Draw3dRect(rcClient, RGB(166, 180, 207), RGB(69, 86, 144)); rcClient.DeflateRect(1, 1); pDC->Draw3dRect(rcClient, RGB(255, 255, 255), RGB(207, 222, 244)); rcClient.DeflateRect(1, 1); CRect rcBackground(rcClient.left, rcClient.top, rcClient.right, rcClient.top + 12); XTPDrawHelpers()->GradientFill(pDC, rcBackground, RGB(207, 215, 236), RGB(255, 255, 255) , FALSE); rcBackground = CRect(rcClient.left, rcBackground.bottom, rcClient.right, rcClient.top + 23); XTPDrawHelpers()->GradientFill(pDC, rcBackground, RGB(255, 255, 255), RGB(207, 221, 244), FALSE); rcBackground = CRect(rcClient.left, rcBackground.bottom, rcClient.right, rcClient.top + 40); XTPDrawHelpers()->GradientFill(pDC, rcBackground, RGB(207, 221, 244), RGB(255, 255, 255), FALSE); rcBackground = CRect(rcClient.left, rcBackground.bottom, rcClient.right, rcClient.bottom); XTPDrawHelpers()->GradientFill(pDC, rcBackground, RGB(255, 255, 255), RGB(207, 221, 244), FALSE); CRect rcFrame(rcClient.left, rcClient.top + 22, rcClient.right, rcClient.bottom); pDC->Draw3dRect(rcFrame, RGB(114, 142, 184), RGB(185, 201, 239)); }
void AudioOutPanel::drawRect( CDrawContext* pContext, const CRect& updateRect ) { pContext->setLineWidth( 1 ); pContext->setFrameColor( colors.fill2 ); pContext->setFillColor( colTransparent ); CRect rcFrame( size.left, size.top+15, size.right, size.bottom ); pContext->drawRect( rcFrame, kDrawFilledAndStroked ); drawBackToFront( pContext, updateRect ); setDirty( false ); }
HRESULT CShadeWnd::UpdateUI() { if(m_pMask == NULL) { return __super::UpdateUI(); } if(m_pRootFrame == NULL) { return E_FAIL; } HDC hdcScreen = ::GetDC(NULL); CRect rcWindow; GetWindowRect(&rcWindow); CRect rcFrame(0,0,rcWindow.Width(),rcWindow.Height()); HDC hdcMem = ::CreateCompatibleDC(hdcScreen); HBITMAP hBmp = ::CreateCompatibleBitmap( hdcScreen, rcWindow.Width(),rcWindow.Height() ); HGDIOBJ hBmpOld = ( HBITMAP )::SelectObject( hdcMem, hBmp ); if ( hdcMem && hBmp) { PaintBkg(hdcMem); Util::BroadcastPaint(m_pRootFrame,hdcMem,m_pRootFrame->GetPaintRect(),rcFrame); CreateShadow(hdcMem,CSize(rcWindow.Width(),rcWindow.Height()),m_rcMaskMargin); BLENDFUNCTION blend; blend.BlendOp = AC_SRC_OVER; blend.BlendFlags = 0; blend.SourceConstantAlpha = 255; blend.AlphaFormat = AC_SRC_ALPHA; ::UpdateLayeredWindow(m_hWnd, hdcScreen, &rcWindow.TopLeft(),&rcWindow.Size(), hdcMem, &CPoint(0,0), RGB(0,0,0), &blend, ULW_ALPHA ); ::SelectObject( hdcMem, hBmpOld ); ::DeleteObject( hBmp ); ::DeleteDC( hdcMem ); ::ReleaseDC(NULL,hdcScreen); } return S_OK; }