Ignore:
Timestamp:
Mar 18, 2002, 2:03:53 PM (23 years ago)
Author:
sandervl
Message:

PF: fix for 24 bpp bitmaps

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/dib.cpp

    r4601 r8097  
    1 /* $Id: dib.cpp,v 1.8 2000-11-15 20:44:26 sandervl Exp $ */
     1/* $Id: dib.cpp,v 1.9 2002-03-18 13:03:53 sandervl Exp $ */
    22
    33/*
     
    8282    else  /* assume BITMAPINFOHEADER */
    8383    {
    84         colors = info->bmiHeader.biClrUsed;
    85         if (!colors && (info->bmiHeader.biBitCount <= 8))
    86             colors = 1 << info->bmiHeader.biBitCount;
     84#ifdef __WIN32OS2__
     85        /* many windows apps write bitmaps that have 0x1000000 in biClrUsed when
     86           in 24 bpp, so I think we can do generic action 24bpp - no clrUsed */
     87        colors = 0;
     88        if (info->bmiHeader.biBitCount <= 8)
     89        {
     90#endif
     91           colors = info->bmiHeader.biClrUsed;
     92           if (!colors)
     93              colors = 1 << info->bmiHeader.biBitCount;
     94#ifdef __WIN32OS2__
     95        }
     96#endif
    8797        return sizeof(BITMAPINFOHEADER) + colors *
    8898               ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD));
Note: See TracChangeset for help on using the changeset viewer.