Author: spouliot
Date: 2007-01-19 14:25:38 -0500 (Fri, 19 Jan 2007)
New Revision: 71361

Modified:
   trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
   trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs
   trunk/mcs/class/System.Drawing/System.Drawing/Image.cs
Log:
2007-01-19  Sebastien Pouliot  <[EMAIL PROTECTED]> 

        * Graphics.cs: Fix FromImage to check for indexed images inside
        managed code (and not GDI+ which will report the wrong error code
        for the exception we expect).
        * Image.cs: Remove unused private method IsIndexedPixelFormat.



Modified: trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2007-01-19 
19:22:33 UTC (rev 71360)
+++ trunk/mcs/class/System.Drawing/System.Drawing/ChangeLog     2007-01-19 
19:25:38 UTC (rev 71361)
@@ -1,3 +1,10 @@
+2007-01-19  Sebastien Pouliot  <[EMAIL PROTECTED]> 
+
+       * Graphics.cs: Fix FromImage to check for indexed images inside
+       managed code (and not GDI+ which will report the wrong error code
+       for the exception we expect).
+       * Image.cs: Remove unused private method IsIndexedPixelFormat.
+
 2007-01-19  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * Font.cs: Fix calls to GDIPlus.ReleaseDC (missing parameter). This

Modified: trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs   2007-01-19 
19:22:33 UTC (rev 71360)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Graphics.cs   2007-01-19 
19:25:38 UTC (rev 71361)
@@ -1752,6 +1752,9 @@
                        if (image == null) 
                                throw new ArgumentNullException ("image");
 
+                       if ((image.PixelFormat & PixelFormat.Indexed) != 0)
+                               throw new Exception (Locale.GetText ("Cannot 
create Graphics from an indexed bitmap."));
+
                        Status status = GDIPlus.GdipGetImageGraphicsContext 
(image.nativeObject, out graphics);
                        GDIPlus.CheckStatus (status);
                        Graphics result = new Graphics (graphics);

Modified: trunk/mcs/class/System.Drawing/System.Drawing/Image.cs
===================================================================
--- trunk/mcs/class/System.Drawing/System.Drawing/Image.cs      2007-01-19 
19:22:33 UTC (rev 71360)
+++ trunk/mcs/class/System.Drawing/System.Drawing/Image.cs      2007-01-19 
19:25:38 UTC (rev 71361)
@@ -76,12 +76,6 @@
                }
        }
 
-       private static bool IsIndexedPixelFormat(PixelFormat pixfmt)
-       {
-               return ((pixfmt & PixelFormat.Indexed) != 0);
-       }
-
-       
        void ISerializable.GetObjectData(SerializationInfo info, 
StreamingContext context)
        {
                MemoryStream ms = new MemoryStream ();

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

Reply via email to