Archived

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

Kaldurin

Loading a bitmap into a surface and displaying it

Recommended Posts

Kaldurin    122
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
Guest Anonymous Poster   
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
Big Sassy    311
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
Kaldurin    122
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