Commit in reactos/lib/user32/controls on MAIN
static.c+15-41.11 -> 1.12
- Support for SS_REALSIZEIMAGE and SS_CENTERIMAGE flags for bitmap static controls.

reactos/lib/user32/controls
static.c 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- static.c	1 Feb 2004 15:52:02 -0000	1.11
+++ static.c	10 Mar 2004 23:21:56 -0000	1.12
@@ -1,4 +1,4 @@
-/* $Id: static.c,v 1.11 2004/02/01 15:52:02 gvg Exp $
+/* $Id: static.c,v 1.12 2004/03/10 23:21:56 navaraf Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS User32
@@ -126,6 +126,7 @@
 static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
 {
     HBITMAP hOldBitmap;
+    LONG full_style = GetWindowLongA( hwnd, GWL_STYLE );
 
     if ((style & SS_TYPEMASK) != SS_BITMAP) return 0;
     if (hBitmap && GetObjectType(hBitmap) != OBJ_BITMAP) {
@@ -133,7 +134,7 @@
     	return 0;
     }
     hOldBitmap = (HBITMAP)SetWindowLongA( hwnd, HICON_GWL_OFFSET, (LONG)hBitmap );
-    if (hBitmap)
+    if (hBitmap && !(full_style & SS_REALSIZEIMAGE))
     {
         BITMAP bm;
         GetObjectW(hBitmap, sizeof(bm), &bm);
@@ -598,6 +599,7 @@
     HBRUSH hbrush;
     HDC hMemDC;
     HBITMAP hBitmap, oldbitmap;
+    LONG full_style = GetWindowLongA( hwnd, GWL_STYLE );
 
     GetClientRect( hwnd, &rc );
     hbrush = (HBRUSH)SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC,
@@ -612,8 +614,17 @@
         if (!(hMemDC = CreateCompatibleDC( hdc ))) return;
 	GetObjectW(hBitmap, sizeof(bm), &bm);
 	oldbitmap = SelectObject(hMemDC, hBitmap);
-	BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
-	       SRCCOPY);
+        if (full_style & SS_CENTERIMAGE)
+        {
+            BitBlt(hdc, (rc.right - bm.bmWidth) >> 1,
+                   (rc.bottom - bm.bmHeight) >> 1,
+                   bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
+        }
+        else
+        {
+            BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0,
+                   SRCCOPY);
+        }
 	SelectObject(hMemDC, oldbitmap);
 	DeleteDC(hMemDC);
     }
CVSspam 0.2.8