15,979
社区成员
发帖
与我相关
我的任务
分享
OnPaint()
{
CDC memDC;
CDC *pDC;
pDC = GetDC();
CBitmap bitmap;
BITMAP map;
bitmap.LoadBitmap(IDB_BAK);
bitmap.GetBitmap(&map);
CSize size(map.bmWidth,map.bmHeight);
CRect rect;
rect = new CRect(0,0,size.cx,size.cy);
memDC.CreateCompatibleDC(pDC);
memDC.SelectObject(&bitmap);
pDC->BitBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,SRCCOPY);
//pDC-> StretchBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,size.cx,size.cy,SRCCOPY);
ReleaseDC(pDC);
DeleteDC(memDC);
CDialog::OnPaint();
}