Commit 87e878a6 authored by Felix Nawothnig's avatar Felix Nawothnig Committed by Alexandre Julliard

Fix GetDIBits to retrieve RGB 555 as 16bit BI_RGB and RGB 565 as 16bit

BI_BITFIELDS.
parent ad537671
......@@ -960,12 +960,30 @@ INT WINAPI GetDIBits(
info->bmiHeader.biWidth = bmp->bitmap.bmWidth;
info->bmiHeader.biHeight = bmp->bitmap.bmHeight;
info->bmiHeader.biPlanes = 1;
info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel;
info->bmiHeader.biSizeImage =
DIB_GetDIBImageBytes( bmp->bitmap.bmWidth,
bmp->bitmap.bmHeight,
bmp->bitmap.bmBitsPixel );
info->bmiHeader.biCompression = 0;
switch(bmp->bitmap.bmBitsPixel)
{
case 15:
info->bmiHeader.biBitCount = 16;
info->bmiHeader.biCompression = BI_RGB;
break;
case 16:
info->bmiHeader.biBitCount = 16;
info->bmiHeader.biCompression = BI_BITFIELDS;
((PDWORD)info->bmiColors)[0] = 0xf800;
((PDWORD)info->bmiColors)[1] = 0x07e0;
((PDWORD)info->bmiColors)[2] = 0x001f;
break;
default:
info->bmiHeader.biBitCount = bmp->bitmap.bmBitsPixel;
info->bmiHeader.biCompression = BI_RGB;
break;
}
info->bmiHeader.biXPelsPerMeter = 0;
info->bmiHeader.biYPelsPerMeter = 0;
info->bmiHeader.biClrUsed = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment