Re: [Dev-C++] loading bitmap from resource file
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Lorenzo <co...@in...> - 2002-02-13 15:54:53
|
I didn't understand your question. If you want to display the bitmap that
you have included in exe this is the code:
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
hdcMem = CreateCompatibleDC(hdc);
SelectObject(hdcMem, hBitmap);
SetMapMode(hdcMem, GetMapMode(hdc));
GetObject(hBitmap, sizeof(BITMAP), (LPVOID)&bm);
ptSize.x = bm.bmWidth;
ptSize.y = bm.bmHeight;
DPtoLP(hdc, &ptSize, 1);
ptOrg.x = 0;
ptOrg.y = 0;
DPtoLP(hdcMem, &ptOrg, 1);
BitBlt(hdc, 0, 0, ptSize.x, ptSize.y, hdcMem, ptOrg.x, ptOrg.y,
SRCCOPY);
DeleteDC(hdcMem);
EndPaint(hwnd, &ps);
break;
I attach the full code. If your problem is other explain it again, i don't
understand.
----------------------------------------------------------------------------
---
If debugging is the process of removing bugs,
then programming must be the process of putting them in.
----------------------------------------------------------------------------
---
|