本文整理汇总了C++中CBitmap::BeginPaintInto方法的典型用法代码示例。如果您正苦于以下问题:C++ CBitmap::BeginPaintInto方法的具体用法?C++ CBitmap::BeginPaintInto怎么用?C++ CBitmap::BeginPaintInto使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBitmap
的用法示例。
在下文中一共展示了CBitmap::BeginPaintInto方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RGB
CBitmap *CDeviceView::GrabViewImage()
{
CBitmap *pbm = CBitmap::Create(GetClientSize(), RGB(0, 0, 0), NULL);
if (!pbm)
return NULL;
HDC hDC = pbm->BeginPaintInto();
if (!hDC)
{
delete pbm;
return NULL;
}
OnPaint(hDC);
pbm->EndPaintInto(hDC);
return pbm;
}
示例2: AssureSize
void AssureSize(CBitmap *&pbm, SIZE to)
{
if (!pbm)
return;
SIZE from;
if (!pbm->GetSize(&from))
return;
if (from.cx >= to.cx && from.cy >= to.cy)
return;
CBitmap *nbm = CBitmap::Create(to, RGB(0,0,0));
if (!nbm)
return;
HDC hDC = nbm->BeginPaintInto();
pbm->Draw(hDC);
nbm->EndPaintInto(hDC);
delete pbm;
pbm = nbm;
nbm = NULL;
}
示例3: OnPaint
void CDeviceView::OnPaint(HDC hDC)
{
HDC hBDC = NULL, hODC = NULL;
CBitmap *pbm = NULL;
if (!InRenderMode())
{
hODC = hDC;
pbm = CBitmap::Create(GetClientSize(), RGB(0, 0, 0), hDC);
if (pbm != NULL)
{
hBDC = pbm->BeginPaintInto();
if (hBDC != NULL)
hDC = hBDC;
}
}
// Black-fill first
SIZE fillsz = GetClientSize();
RECT fillrc = {0, 0, fillsz.cx, fillsz.cy};
FillRect(hDC, &fillrc, (HBRUSH)GetStockObject(BLACK_BRUSH));
if (m_pbmImage != NULL)
m_pbmImage->Blend(hDC);
BOOL bScroll = m_bScrollEnable && m_sb.m_hWnd;
int sdc = 0;
if (bScroll)
{
sdc = SaveDC(hDC);
OffsetViewportOrgEx(hDC, 0, -m_nScrollOffset + g_iListHeaderHeight, NULL);
}
else
if (m_bScrollEnable)
{
sdc = SaveDC(hDC);
OffsetViewportOrgEx(hDC, 0, g_iListHeaderHeight, NULL);
}
int miny = 0 + m_nScrollOffset;
int maxy = g_sizeImage.cy + m_nScrollOffset;
int t, nt = GetNumTexts();
for (t = 0; t < nt; t++)
{
CDeviceViewText *pText = m_arpText[t];
if (pText != NULL &&
!(pText->GetMinY() > maxy || pText->GetMaxY() < miny))
pText->OnPaint(hDC);
}
BOOL bCFGUIEdit = m_ui.m_uig.InEditMode();
BOOL bEitherEditMode = bCFGUIEdit;
int c, nc = GetNumControls();
for (c = 0; c < nc; c++)
if (m_arpControl[c] != NULL && m_arpControl[c]->HasOverlay() &&
(m_arpControl[c]->IsHighlighted()
)
&& (bEitherEditMode || m_arpControl[c]->IsMapped()))
m_arpControl[c]->DrawOverlay(hDC);
for (c = 0; c < nc; c++)
{
CDeviceControl *pControl = m_arpControl[c];
if (pControl != NULL && (bEitherEditMode || pControl->IsMapped()) &&
!(pControl->GetMinY() > maxy || pControl->GetMaxY() < miny))
pControl->OnPaint(hDC);
}
if (bScroll || m_bScrollEnable)
{
RestoreDC(hDC, sdc);
sdc = 0;
}
// Black fill the top portion if this is a list view
if (bScroll)
{
GetClientRect(&fillrc);
fillrc.bottom = g_iListHeaderHeight;
FillRect(hDC, &fillrc, (HBRUSH)GetStockObject(BLACK_BRUSH));
}
// Print out the headers
TCHAR tszHeader[MAX_PATH];
// Control column
if (m_arpText.GetSize())
{
CPaintHelper ph(m_ui.m_uig, hDC);
ph.SetElement(UIE_CALLOUT);
for (int i = 0; i < 2; i++)
{
// Check if there are two columns, break out the 2nd iteration if not 2 columns.
if (i == 1 && !(GetNumControls() > 1 &&
m_arpControl[0]->GetCalloutMaxRect().top == m_arpControl[1]->GetCalloutMaxRect().top))
break;
RECT rcheader;
if (m_arpText.GetSize())
//.........这里部分代码省略.........