Posted on 2013-03-21 12:03
盛胜 阅读(450)
评论(0) 编辑 收藏 引用
int iScreenX = GetSystemMetrics(SM_CXSCREEN);
int iScreenY = GetSystemMetrics(SM_CYSCREEN);
CPaintDC *pdc=&dc;
CRect r;
GetClientRect(&r);
CBitmap *pBitmap= new CBitmap;
pBitmap->LoadBitmap(IDB_CAS_MENU);
BITMAP bm;
// 重绘功能按钮背景
pBitmap->GetBitmap(&bm);
CDC* pDisplayMemDC = new CDC;
pDisplayMemDC->CreateCompatibleDC(pdc);
pDisplayMemDC->SelectObject(pBitmap);
pdc->StretchBlt(0,0,r.right,100,pDisplayMemDC,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
pBitmap->DeleteObject();
//释放资源
ReleaseDC(pDisplayMemDC);
delete pDisplayMemDC;
delete pBitmap;