Fixed CreateCompatibleBitmap when called with 0 width or height.

This commit is contained in:
Eric Pouech 1999-06-07 17:46:39 +00:00 committed by Alexandre Julliard
parent 350075fd28
commit 7990b7c011
1 changed files with 5 additions and 1 deletions

View File

@ -183,6 +183,10 @@ HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height)
FIXME_(bitmap)("got bad width %d or height %d, please look for reason\n",
width, height );
} else {
/* MS doc says if width or height is 0, return 1-by-1 pixel, monochrome bitmap */
if (!width || !height)
hbmpRet = CreateBitmap( 1, 1, 1, 1, NULL );
else
hbmpRet = CreateBitmap( width, height, 1, dc->w.bitsPerPixel, NULL );
if(dc->funcs->pCreateBitmap)
dc->funcs->pCreateBitmap( hbmpRet );