Fixed GetDIBits problems.

This commit is contained in:
Karl Lessard 1999-09-14 11:51:01 +00:00 committed by Alexandre Julliard
parent 32b4325d6b
commit dee464c4c6
3 changed files with 1164 additions and 363 deletions

File diff suppressed because it is too large Load Diff

View File

@ -224,12 +224,13 @@ typedef struct
struct tagDC *dc;
LPCVOID bits;
XImage *image;
PALETTEENTRY *palentry;
int lines;
DWORD infoWidth;
WORD depth;
WORD infoBpp;
WORD compression;
int *colorMap;
RGBQUAD *colorMap;
int nColorMap;
Drawable drawable;
GC gc;

View File

@ -535,7 +535,7 @@ INT WINAPI GetDIBits(
if (bits && lines)
{
/* If the bitmap object already have a dib section that contains image data, get the bits from it*/
if(bmp->dib->dsBm.bmBits && bmp->dib->dsBm.bmBitsPixel >= 16 && info->bmiHeader.biBitCount >= 16)
if(bmp->dib && bmp->dib->dsBm.bmBitsPixel >= 15 && info->bmiHeader.biBitCount >= 15)
{
/*FIXME: Only RGB dibs supported for now */
int srcwidth = bmp->dib->dsBm.bmWidth, srcwidthb = bmp->dib->dsBm.bmWidthBytes;
@ -545,12 +545,13 @@ INT WINAPI GetDIBits(
if ((info->bmiHeader.biHeight < 0) ^ (bmp->dib->dsBmih.biHeight < 0))
{
dbits = bits + (dstwidthb * lines);
dbits = bits + (dstwidthb * (lines-1));
dstwidthb = -dstwidthb;
}
switch( info->bmiHeader.biBitCount ) {
case 15:
case 16: /* 16 bpp dstDIB */
{
LPWORD dstbits = (LPWORD)dbits;