#### Archived

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

# 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 on other sites
ATronic    122
Wow are you being non-specific. You ARE new here! What are you using? OpenGL? Plain Win32?

A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."

##### 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 on other sites
Lugie    122
im using a regular win32 prog, in c++... where do i put the code? and where do i put the image that i made for it?

##### 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