Ignore:
Timestamp:
Dec 20, 1999, 5:45:18 PM (26 years ago)
Author:
cbratschi
Message:

some icon bug fixes

File:
1 edited

Legend:

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

    r2140 r2160  
    1 /* $Id: button.cpp,v 1.22 1999-12-19 17:46:24 cbratschi Exp $ */
     1/* $Id: button.cpp,v 1.23 1999-12-20 16:45:16 cbratschi Exp $ */
    22/* File: button.cpp -- Button type widgets
    33 *
     
    797797            BITMAP   bm;
    798798
    799             GetIconInfo((HICON)infoPtr->hImage, &iconInfo);
    800             GetObjectA (iconInfo.hbmColor, sizeof(BITMAP), &bm);
    801 
    802             imageWidth  = bm.bmWidth;
    803             imageHeight = bm.bmHeight;
    804 
    805             DeleteObject(iconInfo.hbmColor);
    806             DeleteObject(iconInfo.hbmMask);
     799            GetIconInfo((HICON)infoPtr->hImage,&iconInfo);
     800            if (iconInfo.hbmColor)
     801            {
     802              GetObjectA(iconInfo.hbmColor,sizeof(BITMAP),&bm);
     803              imageWidth  = bm.bmWidth;
     804              imageHeight = bm.bmHeight;
     805            } else
     806            {
     807              GetObjectA(iconInfo.hbmMask,sizeof(BITMAP),&bm);
     808              imageWidth  = bm.bmWidth;
     809              imageHeight = bm.bmHeight/2;
     810            }
     811
     812            if (iconInfo.hbmColor) DeleteObject(iconInfo.hbmColor);
     813            if (iconInfo.hbmMask) DeleteObject(iconInfo.hbmMask);
    807814
    808815        }
Note: See TracChangeset for help on using the changeset viewer.