paisano
February 20th, 2003, 01:54 AM
Hi people, iam having trouble with bitmaps, because i dont understand how can i display different bitmaps with out
replacing others. With this code:
hdc = BeginPaint( hwnd, &ps );
memdc = CreateCompatibleDC( hdc );
SelectObject( memdc, hbit );
BitBlt( hdc, 10, 10, 256, 128, memdc, 0, 0, SRCCOPY );
BitBlt( hdc, 300, 100, 256, 128, memdc, 0, 0, SRCCOPY );
EndPaint( hwnd, &ps );
I can only display the same bitmap on different location, but if i create another one and try to do this:
hdc = BeginPaint( hwnd, &ps );
memdc = CreateCompatibleDC( hdc );
SelectObject( memdc, hbit );
SelectObject( memdc, hbit2 ); //The other one
BitBlt( hdc, 10, 10, 256, 128, memdc, 0, 0, SRCCOPY );
BitBlt( hdc, 300, 100, 256, 128, memdc, 0, 0, SRCCOPY );
EndPaint( hwnd, &ps );
It replace the old one with the new one. The last parameter in the function BitBlt say how the colors will work, i guest
thats not my problem, I like to know how i can display diferent bitmaps, with out replace the old one?
Hope some one can help me, thanks and have a nice day.
:confused:
replacing others. With this code:
hdc = BeginPaint( hwnd, &ps );
memdc = CreateCompatibleDC( hdc );
SelectObject( memdc, hbit );
BitBlt( hdc, 10, 10, 256, 128, memdc, 0, 0, SRCCOPY );
BitBlt( hdc, 300, 100, 256, 128, memdc, 0, 0, SRCCOPY );
EndPaint( hwnd, &ps );
I can only display the same bitmap on different location, but if i create another one and try to do this:
hdc = BeginPaint( hwnd, &ps );
memdc = CreateCompatibleDC( hdc );
SelectObject( memdc, hbit );
SelectObject( memdc, hbit2 ); //The other one
BitBlt( hdc, 10, 10, 256, 128, memdc, 0, 0, SRCCOPY );
BitBlt( hdc, 300, 100, 256, 128, memdc, 0, 0, SRCCOPY );
EndPaint( hwnd, &ps );
It replace the old one with the new one. The last parameter in the function BitBlt say how the colors will work, i guest
thats not my problem, I like to know how i can display diferent bitmaps, with out replace the old one?
Hope some one can help me, thanks and have a nice day.
:confused: