Author: pbartok
Date: 2005-03-18 16:24:23 -0500 (Fri, 18 Mar 2005)
New Revision: 42009

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
Log:
        * ThemeWin32Classic.cs (DrawPictureBox):
          - Fixed calculations for centered drawing
          - Fixed drawing for normal mode, not scaling the image on normal

2005-03-18  Peter Bartok  <[EMAIL PROTECTED]>



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-18 19:54:48 UTC (rev 42008)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2005-03-18 21:24:23 UTC (rev 42009)
@@ -1,5 +1,11 @@
 2005-03-18  Peter Bartok  <[EMAIL PROTECTED]>
 
+       * ThemeWin32Classic.cs (DrawPictureBox):
+         - Fixed calculations for centered drawing
+         - Fixed drawing for normal mode, not scaling the image on normal
+
+2005-03-18  Peter Bartok  <[EMAIL PROTECTED]>
+
        * ComboBox.cs: Now also firing the OnKeyPress events for the embedded
          textbox
        * FileDialog.cs:

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2005-03-18 19:54:48 UTC (rev 42008)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs 
    2005-03-18 21:24:23 UTC (rev 42009)
@@ -2176,30 +2176,23 @@
                #region PictureBox
                public override void DrawPictureBox (Graphics dc, PictureBox 
pb) {
                        Rectangle client = pb.ClientRectangle;
-                       int x, y, width, height;
 
                        dc.FillRectangle (new SolidBrush (pb.BackColor), 
client);
 
-                       x = y = 0;
                        if (pb.Image != null) {
                                switch (pb.SizeMode) {
                                case PictureBoxSizeMode.StretchImage:
-                                       width = client.Width;
-                                       height = client.Height;
+                                       dc.DrawImage (pb.Image, 0, 0, 
client.Width, client.Height);
                                        break;
+
                                case PictureBoxSizeMode.CenterImage:
-                                       width = client.Width;
-                                       height = client.Height;
-                                       x = width / 2;
-                                       y = (height - pb.Image.Height) / 2;
+                                       dc.DrawImage (pb.Image, (client.Width / 
2) - (pb.Image.Width / 2), (client.Height / 2) - (pb.Image.Height / 2));
                                        break;
                                default:
                                        // Normal, AutoSize
-                                       width = client.Width;
-                                       height = client.Height;
+                                       dc.DrawImage(pb.Image, 0, 0);
                                        break;
                                }
-                               dc.DrawImage (pb.Image, x, y, width, height);
                        }
                        CPDrawBorderStyle (dc, client, pb.BorderStyle);
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to