- Sync in rev 37720: Magnus Olsen, add GdiGetBitmapBitsSize is a new api from windows xp sp3, the code was tested in vs2003.

svn path=/trunk/; revision=37766
This commit is contained in:
James Tabor
2008-11-30 13:17:19 +00:00
parent dbdbfd482e
commit b92cf193fb
+42 -2
View File
@@ -125,6 +125,48 @@ DIB_GetBitmapInfo(const BITMAPINFOHEADER *header,
return -1;
}
/*
* @implemented
*/
int
WINAPI
GdiGetBitmapBitsSize(BITMAPINFO *lpbmi)
{
int retSize;
if (lpbmi->bmiHeader.biSize == FIELD_OFFSET(BITMAPINFOHEADER, biPlanes))
{
/* Calc the bits Size and align it*/
retSize = HIWORD(lpbmi->bmiHeader.biWidth) * ((LOWORD(lpbmi->bmiHeader.biWidth) *
LOWORD(lpbmi->bmiHeader.biHeight) * HIWORD(lpbmi->bmiHeader.biHeight) + 31)
& -32) / 8;
}
else
{
if ( (lpbmi->bmiHeader.biCompression == BI_BITFIELDS) ||
(lpbmi->bmiHeader.biCompression == BI_RGB))
{
if (lpbmi->bmiHeader.biHeight >=0 )
{
/* Calc the bits Size and align it*/
retSize = lpbmi->bmiHeader.biHeight * ((lpbmi->bmiHeader.biWidth *
lpbmi->bmiHeader.biPlanes * lpbmi->bmiHeader.biBitCount + 31) & -32) / 8;
}
else
{
/* Make height postiive if it negitve then calc the bits Size and align it*/
retSize = (-lpbmi->bmiHeader.biHeight) * ((lpbmi->bmiHeader.biWidth *
lpbmi->bmiHeader.biPlanes * lpbmi->bmiHeader.biBitCount + 31) & -32) / 8;
}
}
else
{
retSize = lpbmi->bmiHeader.biSizeImage;
}
}
return retSize;
}
/*
* @implemented
*/
@@ -180,8 +222,6 @@ CreateDIBSection(
}
/*
* @implemented
*/