本文整理汇总了C++中CAutoRefPtr::CombineRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CAutoRefPtr::CombineRect方法的具体用法?C++ CAutoRefPtr::CombineRect怎么用?C++ CAutoRefPtr::CombineRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAutoRefPtr
的用法示例。
在下文中一共展示了CAutoRefPtr::CombineRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnRedraw
void SItemPanel::OnRedraw(const CRect &rc)
{
if(m_pFrmHost->IsUpdateLocked()) return;
CRect rcItem=GetItemRect();
if(!rcItem.IsRectNull() && m_pFrmHost->IsVisible(TRUE))
{
if(m_pItemContainer->IsItemRedrawDelay())
{
CRect rc2(rc);
rc2.OffsetRect(rcItem.TopLeft());
rc2.IntersectRect(rc2,rcItem);
CRect rcHostClient = m_pFrmHost->GetClientRect();
rc2.IntersectRect(rc2,rcHostClient);
m_pFrmHost->InvalidateRect(rc2);
}else
{
IRenderTarget *pRT=OnGetRenderTarget(rc,OLEDC_PAINTBKGND);
CAutoRefPtr<IRegion> rgn;
GETRENDERFACTORY->CreateRegion(&rgn);
rgn->CombineRect(&rc,RGN_COPY);
RedrawRegion(pRT,rgn);
OnReleaseRenderTarget(pRT,rc,OLEDC_PAINTBKGND);
}
}
}
示例2: Draw
HRESULT RichEditOleBase::Draw(
DWORD dwDrawAspect,
LONG lindex,
void *pvAspect,
DVTARGETDEVICE *ptd,
HDC hdcTargetDev,
HDC hdcDraw,
LPCRECTL lprcBounds,
LPCRECTL lprcWBounds,
BOOL ( STDMETHODCALLTYPE *pfnContinue )(ULONG_PTR dwContinue),
ULONG_PTR dwContinue)
{
InvertBorder(hdcDraw, (RECT*)lprcBounds);
m_rcObj = (RECT*)lprcBounds;
m_rcObj.InflateRect(-1,-1,-1,-1); // 四周留一个像素给RichEdit画反色框
m_oleWindow.SetOleWindowRect(m_rcObj);
CAutoRefPtr<IRegion> rgn;
GETRENDERFACTORY->CreateRegion(&rgn);
rgn->CombineRect((RECT*)lprcBounds,RGN_AND);
CAutoRefPtr<IRenderTarget> pRT;
GETRENDERFACTORY->CreateRenderTarget(&pRT, m_rcObj.Width(), m_rcObj.Height());
// 画背景
HDC hdc = pRT->GetDC(0);
::BitBlt(hdc, 0, 0, m_rcObj.Width(), m_rcObj.Height(),
hdcDraw, m_rcObj.left, m_rcObj.top,
SRCCOPY);
// 画richedit
m_oleWindow.RedrawRegion(pRT, rgn);
// 贴到目标DC
::BitBlt(hdcDraw, m_rcObj.left, m_rcObj.top, m_rcObj.Width(), m_rcObj.Height(),
hdc, 0, 0,
SRCCOPY);
pRT->ReleaseDC(hdc);
return S_OK;
}