Heres all the code i have relating to my bitmap that won't load, anyone see whats wrong with it, i'm using Borland C++ 5.0
//Test.RC
TEST BITMAP DISCARDABLE "test.bmp"
//In CPP file.
static HBITMAP hBitmap;
static int cxClient, cyClient, cxSource, cySource;
BITMAP bitmap;
HDC hdc,hdcMem;
HINSTANCE hInstance;
int x,y;
PAINTSTRUCT ps;
case WM_CREATE:
{
hBitmap = LoadBitmap(hInstance,"TEST");
GetObject(hBitmap,sizeof(BITMAP), &bitmap);
cxSource = bitmap.bmWidth;
cySource = bitmap.bmHeight;
return(0);
}
case WM_SIZE:
{
cxClient = LOWORD(lParam);
cyClient = HIWORD(lParam);
return(0);
}
case WM_PAINT:
{
hdc = BeginPaint(hwnd,&ps);
hdcMem = CreateCompatibleDC(hdc);
SelectObject(hdcMem,hBitmap);
for(y=0;y<cyClient;y+=cySource)
for(x=0;x<cxClient;x+=cxSource)
{
BitBlt(hdc,x,y,cxSource,cySource,hdcMem,0,0,SRCCOP Y);
}
DeleteDC(hdcMem);
EndPaint(hwnd,&ps);
return(0);
} break;
case WM_DESTROY:
{
DeleteObject(hBitmap);
PostQuitMessage(0);
return(0);
} break;



LinkBack URL
About LinkBacks


