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

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Sun Nov 30 14:17:19 CET 2008


Author: jimtabor
Date: Sun Nov 30 07:17:19 2008
New Revision: 37766

URL: http://svn.reactos.org/svn/reactos?rev=37766&view=rev
Log:
- Sync in rev 37720: Magnus Olsen, add GdiGetBitmapBitsSize is a new api from windows xp sp3, the code was tested in vs2003.

Modified:
    trunk/reactos/dll/win32/gdi32/objects/bitmap.c

Modified: trunk/reactos/dll/win32/gdi32/objects/bitmap.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/bitmap.c?rev=37766&r1=37765&r2=37766&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/bitmap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/bitmap.c [iso-8859-1] Sun Nov 30 07:17:19 2008
@@ -123,6 +123,48 @@
   }
   DPRINT("(%ld): wrong size for header\n", header->biSize );
   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;
 }
 
 /*
@@ -178,8 +220,6 @@
 
    return hBitmap;
 }
-
-
 
 
 /*



More information about the Ros-diffs mailing list