im trying to create an image thats a button
-
can u tell me whats wrong with my code plz: HBITMAP hbmp = LoadBitmap(hinst,MAKEINTRESOURCE(IDB_BITMAP1)); RECT r; GetWindowRect(hBtn1,&r); HDC pthisDC; HDC bmpDC; HBITMAP pOldBitmap; pthisDC = GetDC(hWnd); bmpDC = CreateCompatibleDC(pthisDC); pOldBitmap = (HBITMAP)SelectObject(bmpDC,&hbmp); BitBlt(pthisDC, 0,0, r.right-r.left, r.bottom-r.top, bmpDC, 0,0,SRCCOPY); SelectObject(bmpDC,pOldBitmap); DeleteDC(bmpDC); help would be appreciated :-D
-
can u tell me whats wrong with my code plz: HBITMAP hbmp = LoadBitmap(hinst,MAKEINTRESOURCE(IDB_BITMAP1)); RECT r; GetWindowRect(hBtn1,&r); HDC pthisDC; HDC bmpDC; HBITMAP pOldBitmap; pthisDC = GetDC(hWnd); bmpDC = CreateCompatibleDC(pthisDC); pOldBitmap = (HBITMAP)SelectObject(bmpDC,&hbmp); BitBlt(pthisDC, 0,0, r.right-r.left, r.bottom-r.top, bmpDC, 0,0,SRCCOPY); SelectObject(bmpDC,pOldBitmap); DeleteDC(bmpDC); help would be appreciated :-D