Archived

This topic is now archived and is closed to further replies.

Lugie

New Programmer/Wannabe Here

Recommended Posts

Lugie    122
well i was just fooling around with c++, and i cant seem to figure out how to put a background image onto the back of my program (where the default gray would be) any help please?

Share this post


Link to post
Share on other sites
ATronic    122
Wow are you being non-specific. You ARE new here! What are you using? OpenGL? Plain Win32?

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post


Link to post
Share on other sites
BSXrider    122
  
LOGBRUSH background;
background.lbStyle = BS_PATTERN;
background.lbHatch = (long) LoadImage(hInstance,"Bitmap.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
wndclass.hbrBackground = CreateBrushIndirect(&background);


Or something like that. Look up LOGBRUSH and LoadImage in MSDN for more details.

- seb

Share this post


Link to post
Share on other sites
BSXrider    122
In your winmain somewhere you''ll ahve something along the lines of wndclass.hbrbackground = ....

Replace that line with all of the above. If you don''t have that line just chuck all of the above in with the other wndclass.property initialisations.

If you don''t know what I''m talking about look up WNDCLASS on msdn.

Just put the bitmap in the same folder as your source code file and change the code above to suit what you''ve called your file.

- seb

Share this post


Link to post
Share on other sites