Hi
Im trying to load a BMP onto a DialogBox, but it never displays...
heres my code:
In my resource.rc file i have this:
Code:
IDB_WALLS BITMAP "wall.bmp"
IDD_TESTBMP DIALOGEX 225, 200, 486, 313
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Cell:"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,429,7,50,14
CONTROL "",IDB_WALLS,"Static",SS_BITMAP,0,0,305,278
END
In my Resource.h file i have the following:
Code:
#define IDB_WALLS 501
Code:
case WM_INITDIALOG:
{
hDC = BeginPaint(hWnd, &Ps);
walls = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_WALLS));
if(walls == NULL)
MessageBox(hwnd, "Could not load Bitmap!", "Error", MB_OK | MB_ICONEXCLAMATION);
break;
MemDC = CreateCompatibleDC(hDC);
SelectObject(MemDC, walls);
//Works?
BitBlt(hDC, 0, 0, 305, 278, MemDC, 0, 0, SRCCOPY);
DeleteDC(MemDC);
DeleteObject(walls);
return TRUE;
}
Now the dimensions of the BMP are 305x278, and im unsure the BitBlt() function call has the correct parameters? Im sure its something like im drawing on the wrong portion of the DialogBox? Ive also checked the file is in the correct directory also, and im using DevC++ / WinXP
Any help appreciated greatly !