RECT IRectComponent::GetDisplayRect() const { RECT fullRect = GetFullRect(); RECT dispRect = fullRect; boost::shared_ptr<ComponentInterface> pInterface = GetGlobalInterface(); if (pInterface != nullptr && !pInterface->ClipStack.IsEmpty()) IntersectRect(&dispRect, &fullRect, pInterface->ClipStack.Top()); return dispRect; }
void CSkinItemSlider::DrawForeground(CDC* pDC, LPRECT lpInvalidRect, CRgn* pInvalidRgn) { CImageBase* pImage = m_pThumbNormalImage; if (pImage == NULL) pImage = m_pThumbClickImage; if (pImage != NULL) { CRect thumbRect = GetSkinAbsRect(); //GetThumbRect(thumbRect); GetThumbImgRect(thumbRect); pImage->Draw(*pDC, &thumbRect, NULL, GetImageParam(), GetTransformedTransparentColor(), true); } /////////////DragonZ///////////////// CImageBase* pFullImage = m_pFullImage; if (pFullImage == NULL) pFullImage = m_pFullImage; if (pFullImage != NULL) { CRect fullRect = GetSkinAbsRect(); GetFullRect(fullRect); LONG lBarHeight = GetbarHeight(); if (lBarHeight > 0) { if (!m_bVeritySlider) { fullRect.top = fullRect.top - (lBarHeight - fullRect.Height())/2; fullRect.bottom = fullRect.top + lBarHeight; }else { fullRect.left = fullRect.left + (fullRect.Width() - lBarHeight)/2; fullRect.right = fullRect.left + lBarHeight; } } LONG lFullBegin = GetfullBegin(); if (lFullBegin > 0) { if (!m_bVeritySlider) { fullRect.left = fullRect.left + lFullBegin; }else { fullRect.bottom = fullRect.bottom - lFullBegin; // 从下往上填充 } } pFullImage->Draw(*pDC, &fullRect, NULL, GetImageParam(), GetTransformedTransparentColor()); } ///////////////////////////////////// }