Win32 bitmaps

  • Thread starter Thread starter Tang
  • Start date Start date
T

Tang

IM new to windows programming. Ive been trying to load an
bitmap into my hdc and display it. My specific problem,
Im programming pong. I want to use a bitma to represent
the ball, but im having tons of trouble. Im pretty sure
ive got it loaded. Ive called loadbitmap, select object,
get object and Bitblt, and im compiling...i just dont
know where to go from here. any help would be greatly
appreciated...thanks.
 
Tang said:
IM new to windows programming. Ive been trying to load an
bitmap into my hdc and display it. My specific problem,
Im programming pong. I want to use a bitma to represent
the ball, but im having tons of trouble. Im pretty sure
ive got it loaded. Ive called loadbitmap, select object,
get object and Bitblt, and im compiling...i just dont
know where to go from here. any help would be greatly
appreciated...thanks.

It's hard to say what's going wrong without more information but I'll
guess anyway....

The GDI supports a lot of objects like brushes, pens, fonts, bitmaps
etc... If I recall correctly, they can all, except the bitmap object, be
selected into the device context that represents the screen using
SelectObject. Maybe this is where you're going wrong. To display a
bitmap on the screen's device context you have to select the bitmap to a
memory device context and then blit from there to the device context of
the screen.
 
Back
Top