填充白背景:COLORREF colorref=pPicDC->GetBkColor();CBrush* pBrush=(CBrush*)pPicDC->CreateObject();pBrush->CreateSolidBrush(colorref);pPicDC->FillRect(rect,pBrush);
其中pPicDC是绘图区的DC指针
填充系统背景:
CDC* pDC=CWnd::GetDC();
DWORD colorref=GetSysColor(COLOR_BTNFACE);
CRect rect;
GetDlgItem(IDC_PIC)->GetWindowRect(&rect);
ScreenToClient(&rect);
CBrush* pBrush=(CBrush*)pDC->CreateObject();
pBrush->CreateSolidBrush(colorref);
pDC->FillRect(rect,pBrush);