2005-09-26 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / class / System.Drawing / System.Drawing / Graphics.cs
index c90c0ab32875b52df067228b67d8d8ea51643245..42b107c18b478a1d556dc7a4a516ee1f83661f0f 100644 (file)
@@ -1291,12 +1291,8 @@ namespace System.Drawing
                {
                        IntPtr graphics;
 
-                       if (image == null) throw new ArgumentException ();
-
-                       if ((image.PixelFormat & PixelFormat.Indexed) != PixelFormat.Undefined) {\r
-                               // And MS ignores its own rules again\r
-                               throw new Exception ("A Graphics object cannot be created from an image that has an indexed pixel format");\r
-                       }\r
+                       if (image == null) 
+                               throw new ArgumentNullException ();
 
                        Status status = GDIPlus.GdipGetImageGraphicsContext (image.nativeObject, out graphics);
                        GDIPlus.CheckStatus (status);