Re: [Dev-C++] bitmap picture as background?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Niklas K. R. <nik...@ho...> - 2003-01-13 11:08:23
|
tjek this:
in resource.rc
------------------------------------------------------------------
#include "define.h"
IDBM_WELCOME_BG BITMAP "C:\bg_welcome.bmp"
------------------------------------------------------------------
in define.h
------------------------------------------------------------------
IDBM_WELCOME_BG 1000
------------------------------------------------------------------
in main.cpp (case WM_CREATE:)
------------------------------------------------------------------
static HBITMAP hBmBg;
hBmBg = LoadBitmap(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDBM_WELCOME_BG));
if(hBmBg == NULL)
{
MessageBox(hWndWelcome, "Could not load IDBM_WELCOME_BG!",
"Error", MB_OK | MB_ICONEXCLAMATION);
}
------------------------------------------------------------------
in main.cpp (case WM_PAINT:)
------------------------------------------------------------------
PAINTSTRUCT ps ;
BITMAP bm;
HDC hdc, hdcMem;
hdc = BeginPaint(hWndWelcome, &ps);
hdcMem = CreateCompatibleDC(hdc);
SelectObject(hdcMem, hBmBg);
GetObject(hBmBg, sizeof(bm), &bm);
BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);
DeleteDC(hdcMem);
EndPaint (hWndWelcome, &ps) ;
return 0 ;
------------------------------------------------------------------
btw. remember #include "define.h" in main.cpp
-Niklas
>From: "Daniel Glenfield" <sp...@ho...>
>To: dro...@ho..., dev...@li...
>Subject: Re: [Dev-C++] bitmap picture as background?
>Date: Mon, 13 Jan 2003 07:48:19 +0000
>
>
>
>on the background of what? as the background of a dialog box, of a button,
>you could use directX or openGL to do this, many different ways.
>
>>From: "Danny Roelofs" <dro...@ho...>
>>To: <dev...@li...>
>>Subject: [Dev-C++] bitmap picture as background?
>>Date: Sun, 12 Jan 2003 23:57:12 +0100
>>
>>Hi,
>>
>>I am not that kind of guy who want to use library's like MFC to make the
>>job easy. so who can tell me, or send me a source which
>>works whith DevC which can learn me how to show a picture on the
>>background.. preferable a bitmap image..
>>
>>thanks,
>>
>>danny.
>>
>
>
>_________________________________________________________________
>The new MSN 8: smart spam protection and 2 months FREE*
>http://join.msn.com/?page=features/junkmail
>
>
>
>-------------------------------------------------------
>This SF.NET email is sponsored by:
>SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
>http://www.vasoftware.com
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*
http://join.msn.com/?page=features/virus
|