Advertisement Jump to content


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


Bitmap problem

This topic is 5832 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

I''m trying to display 2 bitmaps in my program, but after I display 1, the other one displays the same bitmap as the first. Is there something I have to add to display multiple bitmaps? Here''s my code: void Display_Bitmaps(HDC hdc) { BITMAP bm; title = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(TITLE_ID)); HDC hdcMem = CreateCompatibleDC(hdc); SelectObject(hdcMem,title); GetObject(title, sizeof(bm), &bm); BitBlt(hdc, 230, 30, 580, 270, hdcMem, 0, 0, SRCCOPY); DeleteDC(hdcMem); DeleteObject(title); //The above works and displays the bitmap //But the below doesn''t work- it doesn''t display the other bitmap BITMAP bm2; score = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(SCORE)); HDC hdcMem2 = CreateCompatibleDC(hdc); SelectObject(hdcMem2,score); GetObject(score, sizeof(bm2), &bm2); BitBlt(hdc, 20,500,bm2.bmWidth,bm2.bmHeight, hdcMem2, 0, 0, SRCCOPY); DeleteDC(hdcMem2); DeleteObject(score); } Any help would be great!

Share this post

Link to post
Share on other sites
Maybe I havn''t explained it well enough,

I''m trying to display multiple bitmaps in my program,
but for some reason it doesn''t work- it displays the same two bitmaps instead of displaying different ones.

Is there something I have to do to display multiple bitmaps??

Thanks for ya time

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!