本文整理汇总了C++中CAutoRefPtr::SetRgn方法的典型用法代码示例。如果您正苦于以下问题:C++ CAutoRefPtr::SetRgn方法的具体用法?C++ CAutoRefPtr::SetRgn怎么用?C++ CAutoRefPtr::SetRgn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAutoRefPtr
的用法示例。
在下文中一共展示了CAutoRefPtr::SetRgn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _Draw
void SSkinButton::_Draw(IRenderTarget *pRT, LPCRECT prcDraw, DWORD dwState,BYTE byAlpha)
{
CRect rcDraw = *prcDraw;
rcDraw.DeflateRect(1, 1);
CAutoRefPtr<IRegion> rgnClip;
if(m_nCornerRadius>2)
{
GETRENDERFACTORY->CreateRegion(&rgnClip);
//the last two params of CreateRoundRectRgn are width and height of ellipse, thus we should multiple corner radius by 2.
HRGN hRgn = ::CreateRoundRectRgn(prcDraw->left,prcDraw->top,prcDraw->right+1,prcDraw->bottom+1,m_nCornerRadius*2,m_nCornerRadius*2);
rgnClip->SetRgn(hRgn);
DeleteObject(hRgn);
}
if(rgnClip)
pRT->PushClipRegion(rgnClip);
if(m_crUp[dwState]!=m_crDown[dwState])
pRT->GradientFill(rcDraw,TRUE,m_crUp[dwState],m_crDown[dwState],byAlpha);
else
{
SColor cr(m_crDown[dwState]);
cr.updateAlpha(byAlpha);
pRT->FillSolidRect(prcDraw,cr.toCOLORREF());
}
CAutoRefPtr<IPen> pPen,pOldPen;
pRT->CreatePen(PS_SOLID,m_crBorder,1,&pPen);
pRT->SelectObject(pPen,(IRenderObj**)&pOldPen);
pRT->DrawRoundRect(prcDraw,CPoint(m_nCornerRadius,m_nCornerRadius));
pRT->SelectObject(pOldPen);
if(rgnClip)
pRT->PopClip();
}