Ignore:
Timestamp:
Sep 23, 2001, 10:14:08 PM (24 years ago)
Author:
sandervl
Message:

fix for GpiQueryBitmapBits failure (cbImage too small for compressed images)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibsect.cpp

    r6557 r6794  
    1 /* $Id: dibsect.cpp,v 1.56 2001-08-18 03:49:24 phaller Exp $ */
     1/* $Id: dibsect.cpp,v 1.57 2001-09-23 20:14:08 sandervl Exp $ */
    22
    33/*
     
    192192     dprintf2(("Increment section starting at %08X\n",dsect));
    193193
    194      /* @@@PH 98/07/11 fix for dsect->next == NULL */
    195194     while ( (dsect->next != this) &&
    196195             (dsect->next != NULL) )
     
    671670        destBuf = bmpBitsDblBuffer + nYdest*dibinfo.dsBm.bmWidthBytes;
    672671
     672        //SvL: cbImage can be too small for compressed images; GpiQueryBitmapBits
     673        //     will fail in that case (CoolEdit 2000). Perhaps because the returned
     674        //     compressed image is larger than the original.
     675        //     Use uncompressed size instead
     676        //     NOTE: The correct size will be returned by GpiQueryBitmapBits
     677        tmphdr->cbImage = dibinfo.dsBm.bmHeight*dibinfo.dsBm.bmWidthBytes;
     678
    673679        rc = GpiQueryBitmapBits(hdc, nYdest, nDestHeight, destBuf,
    674680                                tmphdr);
     
    683689  }
    684690  else {
     691        //SvL: cbImage can be too small for compressed images; GpiQueryBitmapBits
     692        //     will fail in that case (CoolEdit 2000). Perhaps because the returned
     693        //     compressed image is larger than the original.
     694        //     Use uncompressed size instead
     695        //     NOTE: The correct size will be returned by GpiQueryBitmapBits
     696        tmphdr->cbImage = dibinfo.dsBm.bmHeight*dibinfo.dsBm.bmWidthBytes;
     697
    685698        destBuf = GetDIBObject() + nYdest*dibinfo.dsBm.bmWidthBytes;
    686699        rc = GpiQueryBitmapBits(hdc, nYdest, nDestHeight, destBuf,
    687700                                tmphdr);
    688701
     702        if(rc) {
     703            dprintf(("ERROR: GpiQueryBitmapBits failed with %x", WinGetLastError(0)));
     704        }
    689705#ifdef DEBUG_PALETTE
    690706        if(rc != GPI_ALTERROR && tmphdr->cBitCount <= 8) {
Note: See TracChangeset for help on using the changeset viewer.