From f7da3af16d210a0852ea05ec235768ebd45a72a5 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 23 Aug 2007 22:29:37 +0000 Subject: [PATCH] Fix math and add notes. svn path=/trunk/; revision=28501 --- reactos/dll/win32/gdi32/objects/bitmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/gdi32/objects/bitmap.c b/reactos/dll/win32/gdi32/objects/bitmap.c index 857098dd6fb..f017b361683 100644 --- a/reactos/dll/win32/gdi32/objects/bitmap.c +++ b/reactos/dll/win32/gdi32/objects/bitmap.c @@ -3,7 +3,7 @@ /* * Return the full scan size for a bitmap. * - * Based on Wine and Windows Graphics Prog pg 595 + * Based on Wine, Utils.c and Windows Graphics Prog pg 595 */ UINT FASTCALL @@ -20,10 +20,10 @@ DIB_BitmapMaxBitsSize( PBITMAPINFO Info, UINT ScanLines ) { if ((Info->bmiHeader.biCompression) && (Info->bmiHeader.biCompression != BI_BITFIELDS)) return Info->bmiHeader.biSizeImage; + // Planes are over looked by Yuan. I guess assumed always 1. MaxBits = Info->bmiHeader.biBitCount * Info->bmiHeader.biPlanes * Info->bmiHeader.biWidth; } - // Planes are over looked by Yuan. I guess assumed always 1. - MaxBits = (MaxBits + 31) / 32; // ScanLineSize = (Width * bitcount + 31)/32 + MaxBits = ((MaxBits + 31) & ~31 ) / 8; // From Yuan, ScanLineSize = (Width * bitcount + 31)/32 return (MaxBits * ScanLines); // ret the full Size. }