本文整理汇总了C++中CAutoRefPtr::Size方法的典型用法代码示例。如果您正苦于以下问题:C++ CAutoRefPtr::Size方法的具体用法?C++ CAutoRefPtr::Size怎么用?C++ CAutoRefPtr::Size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAutoRefPtr
的用法示例。
在下文中一共展示了CAutoRefPtr::Size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MakeCacheApha
void SQrCtrl::MakeCacheApha( ISkinObj *pSkin, IBitmap *_pBitCache, IBitmap *_pBitMask )
{
CAutoRefPtr<IRenderTarget> pRTDst;
GETRENDERFACTORY->CreateRenderTarget(&pRTDst, 0, 0);
CAutoRefPtr<IRenderObj> pOldBmp;
pRTDst->SelectObject(_pBitCache, &pOldBmp);
CRect rc(CPoint(0, 0), _pBitCache->Size());
pSkin->Draw(pRTDst, &rc, 0);
CAutoRefPtr<IBitmap> bmp;
GETRENDERFACTORY->CreateBitmap(&bmp);
if (m_QrRect.IsRectEmpty())
{
bmp = _pBitMask;
}
else
{
bmp->Init(m_QrRect.Width(), m_QrRect.Height());
pRTDst->SelectObject(bmp, NULL);
CRect rcSrc(CPoint(0, 0), _pBitMask->Size());
rc = CRect(CPoint(0, 0), bmp->Size());
pRTDst->DrawBitmapEx(rc, _pBitMask, rcSrc, MAKELONG(EM_STRETCH, m_fl));
pRTDst->SelectObject(pOldBmp);
}
int nDesLinePixels = _pBitCache->Width();
int nDesRowPixels = _pBitCache->Height();
int nline = bmp->Height();
int nRow = bmp->Width();
if ((nDesRowPixels < nRow + m_QrRect.top) || (nDesLinePixels < nline + m_QrRect.left))
return;
LPDWORD pBitCache = (LPDWORD)_pBitCache->LockPixelBits();
LPDWORD pBitMask = (LPDWORD)bmp->LockPixelBits();
LPDWORD pDst = pBitCache;
LPDWORD pSrc = pBitMask;
LPDWORD pLine = pDst + m_QrRect.top * nDesLinePixels;
for (int line = 0; line < nline; line++)
{
LPDWORD pLineData = pLine + m_QrRect.left;
for (int row = 0; row < nRow; row++)
{
LPBYTE byAlpha = (LPBYTE)(pSrc + row);
if (byAlpha[3] == 0)
{
LPDWORD pByteAlpha = (pLineData + row);
*pByteAlpha =RGBA(0,0,0,0);
}
}
pSrc += nRow;
pLine += nDesLinePixels;
}
_pBitCache->UnlockPixelBits(pBitCache);
bmp->UnlockPixelBits(pBitMask);
}