Пример #1
0
void SSkinImgList::_Draw(IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState,BYTE byAlpha)
{
    if(!m_pImg) return;
    SIZE sz=GetSkinSize();
    RECT rcSrc={0,0,sz.cx,sz.cy};
    if(m_bVertical) 
        OffsetRect(&rcSrc,0, dwState * sz.cy);
    else
        OffsetRect(&rcSrc, dwState * sz.cx, 0);
    pRT->DrawBitmapEx(rcDraw,m_pImg,&rcSrc,GetExpandMode(),byAlpha);
}
Пример #2
0
void SSkinImgFrame::_Draw(IRenderTarget *pRT, LPCRECT rcDraw, DWORD dwState,BYTE byAlpha)
{
    if(!m_pImg) return;
    SIZE sz=GetSkinSize();
    CPoint pt;
    if(IsVertical())
        pt.y=sz.cy*dwState;
    else
        pt.x=sz.cx*dwState;
    CRect rcSour(pt,sz);
    pRT->DrawBitmap9Patch(rcDraw,m_pImg,&rcSour,&m_rcMargin,GetExpandMode(),byAlpha);
}
Пример #3
0
	void SDemoSkin::_Draw(IRenderTarget * pRT, LPCRECT rcDraw, DWORD dwState, BYTE byAlpha)
	{
		if (m_bIsColor)
		{			
			COLORREF bkColor = m_bkColor | (byAlpha << 24);
			pRT->FillSolidRect(rcDraw, bkColor);
			return;
		}
		if (m_pImg)
		{
			SIZE sz = GetSkinSize();
			CPoint pt(0, 0);
			CRect rcSour(pt, sz);
			pRT->DrawBitmap9Patch(rcDraw, m_pImg, &rcSour, &m_rcMargin, GetExpandMode(), byAlpha);
		}		
	}