• Advertisement

Archived

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

Loading a bitmap into a surface and displaying it

This topic is 5773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I''m doing an application that loads a bitmap into a surface before doing some bltfast to copy it to the backbuffer, but when I flip the back buffer, some strange things are displayed on the screen. As if it was a chess board game but with all sorts of pixel. I could describe it as garbage. I don''t receive error message, so I don''t know where the trouble might be. Could anyone help me ? Surak

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Double check your blitting instructions. The area you''re blitting is probably a little off and you''re blitting a part of memory that isn''t image data.

Share this post


Link to post
Share on other sites
I''m using LoadImage under Windows 98 with the flags LR_LOADFROMFILE | LR_CREATEDIBSECTION.

Surak

Share this post


Link to post
Share on other sites
Are you sure if it''s the loading of the bitmap that''s causing the problem? You could try using a different function to see if that''s the problem (like in DDUtil.h) or you could write your own function. This thread explains how to do the latter. If that doesn''t work, are you clearing the backbuffer before you blit onto it again each time? That may be causing problems if your not.

***********************

Share this post


Link to post
Share on other sites
I''ve found my error ! Finally after searching for about a week and thinking on all possible errors that could be causing that, I just found that when I used SelectObject, for the second parameters, I was giving it the address of the handle to the bitmap instead of the handle to the bitmap. I can''t believe I did a stupid error like that .

Thanks anyway for you help Sassy.

Surak

Share this post


Link to post
Share on other sites

  • Advertisement