Fixed CreateCompatibleBitmap when called with 0 width or height.
This commit is contained in:
parent
350075fd28
commit
7990b7c011
|
@ -183,7 +183,11 @@ 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 {
|
||||
hbmpRet = CreateBitmap( width, height, 1, dc->w.bitsPerPixel, NULL );
|
||||
/* 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 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue