mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-01 19:26:16 +00:00
- 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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user