Marcus Meissner marcus@jet.franken.de writes:
Changelog: In GetBitmapBits() handle the correct bitmap information when a DIB is used.
I think for a DIB we want to copy the bits directly, like we already do in SetBitmapBits. Does this work for you?
diff --git a/dlls/gdi/bitmap.c b/dlls/gdi/bitmap.c index a0c6b25..5c2b6c3 100644 --- a/dlls/gdi/bitmap.c +++ b/dlls/gdi/bitmap.c @@ -307,6 +307,30 @@ LONG WINAPI GetBitmapBits(
if (!bmp) return 0;
+ if (bmp->dib) /* simply copy the bits from the DIB */ + { + DIBSECTION *dib = bmp->dib; + const char *src = dib->dsBm.bmBits; + DWORD max = dib->dsBm.bmWidthBytes * dib->dsBm.bmHeight; + if (count > max) count = max; + ret = count; + if (!bits) goto done; + + if (bmp->dib->dsBmih.biHeight >= 0) /* not top-down, need to flip contents vertically */ + { + src += dib->dsBm.bmWidthBytes * dib->dsBm.bmHeight; + while (count > 0) + { + src -= dib->dsBm.bmWidthBytes; + memcpy( bits, src, min( count, dib->dsBm.bmWidthBytes ) ); + bits = (char *)bits + dib->dsBm.bmWidthBytes; + count -= dib->dsBm.bmWidthBytes; + } + } + else memcpy( bits, src, count ); + goto done; + } + /* If the bits vector is null, the function should return the read size */ if(bits == NULL) {
Am Dienstag, 13. Dezember 2005 11:42 schrieb Alexandre Julliard:
Marcus Meissner marcus@jet.franken.de writes:
Changelog: In GetBitmapBits() handle the correct bitmap information when a DIB is used.
I think for a DIB we want to copy the bits directly, like we already do in SetBitmapBits. Does this work for you?
All three patches (yours and the two by Marcus) fix bug 4034... ;-)
Ciao, Willie
On Tue, Dec 13, 2005 at 07:13:00PM +0100, Willie Sippel wrote:
Am Dienstag, 13. Dezember 2005 11:42 schrieb Alexandre Julliard:
Marcus Meissner marcus@jet.franken.de writes:
Changelog: In GetBitmapBits() handle the correct bitmap information when a DIB is used.
I think for a DIB we want to copy the bits directly, like we already do in SetBitmapBits. Does this work for you?
All three patches (yours and the two by Marcus) fix bug 4034... ;-)
Can also confirm that it fixes the issue.
Ciao, Marcus