BOOL CSTScreenBuffer::DrawStretch(HDC* pDC, RECT rcDest) { POINT ptDest; unsigned int cx; unsigned int cy; ptDest.x = rcDest.left; ptDest.y = rcDest.top; cx = rcDest.right-rcDest.left; cy = rcDest.bottom-rcDest.top; return DrawStretch(pDC, ptDest, cx, cy); }
void XMapLayerImage::Draw( void ) { switch( m_DrawType ) { case xNORMAL: DrawNormal(); break; case xSTRETCH: DrawStretch(); break; case xTILE: DrawTile(); break; default: XBREAK(1); } }
void duListBox::DrawItem(ListBoxItem *pItem, HDC hDC, duStyleGroup *pStyleGroup, duRect &rcItem) { int nAlpha = GetAlpha(); UINT uItemState = DU_STATE_NORMAL; if (m_pSelItem == pItem) uItemState = DU_STATE_PRESS; if (pItem->fDisable) pStyleGroup->Draw(hDC, &rcItem, DU_STATE_DISABLE, pItem->szText.c_str(), nAlpha); else { if (m_pHotItem == pItem) { if (m_pHotItem == m_pSelItem) pStyleGroup->Draw(hDC, &rcItem, DU_STATE_PRESS, pItem->szText.c_str(), nAlpha); else { int nStyleCount = pStyleGroup->GetStyleCount(); int k; for (k = 0; k < nStyleCount; k++) { duStyleBase *pStyle = pStyleGroup->GetStyle(k); if (pStyle && (pStyle->GetState() & DU_STATE_OVER)) { if (pStyle->GetType() != STYLE_TEXT) pStyle->Draw(hDC, &rcItem, pItem->szText.c_str(), m_nAlphaFadeIn); else pStyle->Draw(hDC, &rcItem, pItem->szText.c_str(), nAlpha); } } } } else { pStyleGroup->Draw(hDC, &rcItem, uItemState, pItem->szText.c_str(), nAlpha); } } duImage *pIconImage = (duImage *)GetResObj(pItem->szIcon.c_str(), DU_RES_IMAGE); if (pIconImage == NULL) return; DrawStretch(hDC, rcItem.left + pItem->uIconX, rcItem.top + pItem->uIconY, pItem->uIconWidth, pItem->uIconHeight, pIconImage, 0, 0, pIconImage->GetWidth(), pIconImage->GetHeight(), nAlpha); }