Use the passed hdc in CreateDIBitmap instead of creating a new one.

This commit is contained in:
Alexandre Julliard 2001-08-17 00:07:42 +00:00
parent 78f9fae706
commit e22a1e68cf

View file

@ -875,12 +875,7 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
/* Now create the bitmap */
if (fColor)
{
HDC tmpdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
handle = CreateCompatibleBitmap( tmpdc, width, height );
DeleteDC( tmpdc );
}
if (fColor) handle = CreateCompatibleBitmap( hdc, width, height );
else handle = CreateBitmap( width, height, 1, 1, NULL );
if (!handle) return 0;