Discussion Locked

Bitmap Failure

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Why & in what situations do CreateCompatibleBitmap() failed to create a compatible bitmap in VC++.

8 replies

by sl33te

it seems i can help you here sanjeev, but only one thing: before i can help you i just know these questions:

what version of VC++?
do you get any error messages?
how are you trying to create it?

answer these and i'll get back to you.

sl33te
d_korth@hotmail.com

by sanjeev_guptaji

There is no error message,
just it redraw the bitmap on the previous size.

I am creating the bitmap using CreateCompatibleBitmap(), i.e.,
first creating the memory device context, and then getting into a bitmap of the required size and then select that bitmap into the device context, i.e., using the following functions,

HDC memDC = CreateCompatibleDC ( hDC );
HBITMAP memBM =
CreateCompatibleBitmap( hDC );
SelectObject ( memDC, memBM );

Also, after creating this bitmap, using some scroll, pan & zoom calculation logic, I get the new bitmap size

then I recreate the bitmap using the above functions and it works fine for some time but at a certain size it fails to create the required size and the bitmap gets deteriorated.

This discussion is closed to new replies.