CRect rect , rtWnd;
CDC* pDC;
CBitmap bitmap;
BITMAP stBitmap;
CDC memDC;
CDC dcMem;
// RECT rect;
/*
CPoint point;
//填充顶部框架
point.x = rtWnd.Width();
point.y = GetSystemMetrics(SM_CYSIZE) + GetSystemMetrics(SM_CYFRAME)+20;
pDC->PatBlt(0, 0, point.x, point.y, PATCOPY);
//填充左侧框架
point.x = GetSystemMetrics(SM_CXFRAME) + 1;
point.y = rtWnd.Height();
// pDC->PatBlt(0, 0, point.x, point.y, PATCOPY);
//填充底部框架
point.x = rtWnd.Width();
point.y = GetSystemMetrics(SM_CYFRAME) + 1;
// pDC->PatBlt(0, rtWnd.Height()-point.y, point.x, point.y, PATCOPY);
//填充右侧框架
point.x = GetSystemMetrics(SM_CXFRAME) + 1;
point.y = rtWnd.Height();
pDC->PatBlt(rtWnd.Width()-point.x, 0, point.x, point.y, PATCOPY);
*/
::GetClientRect(GetDlgItem(IDOK)->GetSafeHwnd(),&rect);
int x = GetSystemMetrics(SM_CXSMICON);
int y = GetSystemMetrics(SM_CYSMICON);
pDC = GetDlgItem(IDOK)->GetDC();
// TITLEBARINFO pti;
// GetTitleBarInfo(m_hWnd, &pti);
bitmap.LoadBitmap(IDB_BITMAP2);
//得到位图的尺寸
bitmap.GetObject(sizeof(BITMAP),&stBitmap);
CSize bmsize(stBitmap.bmWidth,stBitmap.bmHeight);
//创建并载入位图
dcMem.CreateCompatibleDC(pDC); // 创建兼容的设备描述表
CBitmap *pold=dcMem.SelectObject(&bitmap);
pDC->StretchBlt(0,0,100,200/*rect.left,rect.top,rect.Width(), rect.Height()*/,&dcMem,0,0,bmsize.cx,bmsize.cy,SRCCOPY); //全显示
//pDC->BitBlt(rect.left,rect.top,rect.Width(), rect.Height(),&dcMem,0,0,SRCCOPY); //实际大小
memDC.DeleteDC();
bitmap.DeleteObject();