15,978
社区成员
发帖
与我相关
我的任务
分享
//绘制背景
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect);
CDC memoryDC;
if ( memoryDC.CreateCompatibleDC(&dc) )
{
BITMAP bm;
m_bmpBK.GetBitmap(&bm);
CBitmap* pOldBitmap = memoryDC.SelectObject(&m_bmpBK);
dc.SetStretchBltMode(COLORONCOLOR);
dc.StretchBlt(rect.left, rect.top, rect.Width(), rect.Height(),
&memoryDC, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
memoryDC.SelectObject(pOldBitmap);
DeleteObject(memoryDC);
}