Changeset 9432


Ignore:
Timestamp:
Nov 26, 2002, 3:41:07 PM (22 years ago)
Author:
sandervl
Message:

Handle icon masks with different line alignment:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/user32/winicon.cpp

    r9409 r9432  
    1 /* $Id: winicon.cpp,v 1.37 2002-11-13 14:54:58 sandervl Exp $ */
     1/* $Id: winicon.cpp,v 1.38 2002-11-26 14:41:07 sandervl Exp $ */
    22/*
    33 * Win32 Icon Code for OS/2
     
    10511051//SvL: Must use CreateBitmap here as CreateDIBitmap converts data to 8bpp (GetObjectA info -> 8 bpp)
    10521052#if 1
    1053                     int linewidth = BITMAP_GetWidthBytes(width, 1);
     1053                    int linewidth;
     1054                    int orglinewidth;
     1055
     1056                    linewidth = BITMAP_GetWidthBytes(width, 1);
     1057
     1058                    //the lines in the image might be aligned differently
     1059                    //CreateBitmap expects them to be optimally aligned
     1060                    //(as calculated by BITMAP_GetWidthBytes)
     1061                    //(For now only applies when both masks (and/xor) aren't present)
     1062                    if(pInfo->bmiHeader.biSizeImage > colorsize + bwsize) {
     1063                         orglinewidth = (pInfo->bmiHeader.biSizeImage - colorsize)/height;
     1064                    }
     1065                    else orglinewidth = linewidth;
    10541066
    10551067                    char *newpix = (char *)malloc(linewidth*height);
     
    10691081                            memcpy(newpix, xbits, linewidth);
    10701082                            newpix -= linewidth;
    1071                             xbits  += linewidth;
     1083                            xbits  += orglinewidth;
    10721084                        }
    10731085                    }
Note: See TracChangeset for help on using the changeset viewer.