Ignore:
Timestamp:
Nov 7, 2001, 8:19:09 PM (24 years ago)
Author:
sandervl
Message:

fix for SS_CENTERIMAGE style

File:
1 edited

Legend:

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

    r5685 r7296  
    1 /* $Id: static.cpp,v 1.24 2001-05-11 08:39:44 sandervl Exp $ */
     1/* $Id: static.cpp,v 1.25 2001-11-07 19:19:09 sandervl Exp $ */
    22/*
    33 * Static control
     
    722722                             hdc, hwnd );
    723723    FillRect( hdc, &rc, hbrush );
     724
    724725    if (dwStyle & SS_CENTERIMAGE)
    725726    {
    726727      ICONINFO ii;
    727728      BITMAP bmp;
     729
     730#if 0
     731//TODO: fill with upper left pixel of icon
     732      COLORREF color;
     733
     734      color = GetPixel(hMemDC, 0, 0);
     735      hbrush = CreateSolidBrush(color);
     736      FillRect( hdc, &rc, hbrush );
     737      DeleteObject(hbrush);
     738#endif
    728739
    729740      if (!GetIconInfo(infoPtr->hIcon,&ii)) return;
     
    738749      if (ii.hbmColor) DeleteObject(ii.hbmColor);
    739750      if (ii.hbmMask) DeleteObject(ii.hbmMask);
    740     } else if (infoPtr->hIcon) DrawIcon(hdc,rc.left,rc.top,infoPtr->hIcon);
     751    }
     752    else
     753    if (infoPtr->hIcon) {
     754        DrawIcon(hdc,rc.left,rc.top,infoPtr->hIcon);
     755    }
    741756}
    742757
     
    753768    hbrush = SendMessageA( GetParent(hwnd), WM_CTLCOLORSTATIC,
    754769                             hdc, hwnd );
    755     FillRect( hdc, &rc, hbrush );
    756770
    757771    if (infoPtr->hIcon)
     
    770784            SIZE szbm;
    771785            SIZE szdc;
     786            COLORREF color;
     787
     788            //SvL: Fill client area with pixel in upper left corner (SDK docs)
     789            color = GetPixel(hMemDC, 0, 0);
     790            hbrush = CreateSolidBrush(color);
     791            FillRect( hdc, &rc, hbrush );
     792            DeleteObject(hbrush);
    772793
    773794            if(bm.bmWidth > rc.right - rc.left)
     
    794815            }
    795816            BitBlt(hdc, szdc.cx, szdc.cy, bm.bmWidth, bm.bmHeight, hMemDC,
    796                 szbm.cx, szbm.cy, SRCCOPY);
     817                   szbm.cx, szbm.cy, SRCCOPY);
    797818        }
    798819        else
    799820        {
     821            FillRect( hdc, &rc, hbrush );
    800822            BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
    801823        }
Note: See TracChangeset for help on using the changeset viewer.