|
HBITMAP hbitmap,hOldBMP,hsysbmp,hbkbmp;
HDC hdcmem,hdcsys,hdcbkbmp;
BITMAP bm;
hsysbmp=CreateCompatibleBitmap(hdc,240,320);
hdcsys=CreateCompatibleDC(hdc);
SelectObject(hdcsys,hsysbmp);
BitBlt(hdc,0,0,240,320,hdcsys,0,0,WHITENESS);
hbkbmp=LoadBitmap(g_hInst,MAKEINTRESOURCE(IDB_BITMAP6));
hdcbkbmp=CreateCompatibleDC(hdc);
SelectObject(hdcbkbmp,hbkbmp);
BitBlt(hdcsys,0,0,240,320,hdcbkbmp,0,0,SRCAND);
hbitmap=LoadBitmap(g_hInst,MAKEINTRESOURCE(IDB_MAINMENUBG));
hdcmem=CreateCompatibleDC(hdc);
GetObject(hbitmap,sizeof(BITMAP),&bm);
hOldBMP=(HBITMAP)SelectObject(hdcmem,hbitmap);
BitBlt(hdcsys,0,0,240,320,hdcmem,0,0,SRCPAINT);
BitBlt(hdc,0,0,bm.bmWidth,bm.bmHeight,hdcsys,0,0,SRCCOPY);
SelectObject(hdcmem,hOldBMP);
DeleteObject(hbkbmp);
DeleteObject(hbitmap);
DeleteObject(hsysbmp);
DeleteDC(hdcsys);
DeleteDC(hdcbkbmp);
DeleteDC(hdcmem);
请问这段代码,没有效果,请问是什么问题?是背景图片吗?背景图该用什么样的
|
|