Skip to main content
gamedev.net
🔒 Locked

Bitmap problem

Started by julienX 0 replies 200+ views
Original Post
julienX
julienX
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!
chacha
julienX
julienX
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
chacha

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.