Ignore:
Timestamp:
Jun 7, 1999, 10:58:22 PM (26 years ago)
Author:
sandervl
Message:

* empty log message *

File:
1 edited

Legend:

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

    r37 r46  
    1 /* $Id: gdi32.cpp,v 1.2 1999-06-06 12:25:48 cbratschi Exp $ */
     1/* $Id: gdi32.cpp,v 1.3 1999-06-07 20:57:59 sandervl Exp $ */
    22
    33/*
     
    4343} POLYTEXTW;
    4444
     45
     46static ULONG QueryPaletteSize(BITMAPINFOHEADER *pBHdr)
     47{
     48        ULONG cbPalette;
     49
     50        switch (pBHdr->biBitCount)
     51        {
     52                case 1:
     53                case 4:
     54                case 8:
     55                        cbPalette = (1 << pBHdr->biBitCount) * sizeof(RGBQUAD);
     56                        break;
     57
     58                case 16:
     59                case 24:
     60                case 32:
     61                        cbPalette = 0;
     62                        break;
     63
     64                default:
     65                        dprintf(("QueryPaletteSize: error pBHdr->biBitCount = %d", pBHdr->biBitCount));
     66                        cbPalette = -1;
     67        }
     68
     69   return cbPalette;
     70}
    4571
    4672static ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy)
     
    18761902    // Dont't like dirty pointers, but Open32 needs a bit help.
    18771903    // Only tested with winmine.
    1878     palsize = (1 << info->bmiHeader.biBitCount) * sizeof(RGBQUAD);
     1904    palsize = QueryPaletteSize((BITMAPINFOHEADER*)&info->bmiHeader);
    18791905    imgsize = CalcBitmapSize(info->bmiHeader.biBitCount,
    18801906                             info->bmiHeader.biWidth, info->bmiHeader.biHeight);
Note: See TracChangeset for help on using the changeset viewer.