[Mono-bugs] [Bug 81128][Wis] New - Painting issue

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Mar 13 00:51:17 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by mitcheloc at gmail.com.


--- shadow/81128	2007-03-12 23:51:17.000000000 -0500
+++ shadow/81128.tmp.17301	2007-03-12 23:51:17.000000000 -0500
@@ -0,0 +1,106 @@
+Bug#: 81128
+Product: Mono: Class Libraries
+Version: 1.2
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: mitcheloc at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Painting issue
+It seems to me that the Bitmap.PixelFormat is not set properly when an
+image is loaded from an embedded resource...
+Graphics memG  = Graphics.FromImage(memoryBitmap);
+if (!mono)
+    Bitmap  skin   = SnapForms.Properties.Resources.Skin;
+    ^^^^ does not work with mono, but the following does:
+    Bitmap  skin    = (Bitmap) Bitmap.FromFile("Skin.jpg");
+The code does not error out until here:
+memG.DrawImage(skin, new Rectangle(Width - 104, 0, 103, 27), new
+Rectangle(skin.Width - 103, 0, 103, 27), GraphicsUnit.Pixel);
+The error is:
+Unhandled Exception: System.ArgumentException: Invalid Parameter. A null
+ce or invalid value was found.
+  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0006d] in
+  at System.Drawing.Image.get_PixelFormat () [0x0000e] in
+  at (wrapper remoting-invoke-with-check)
+System.Drawing.Image:get_PixelFormat (
+  at SnapForms.SkinnedForm.GenerateBackground () [0x00000]
+  at SnapForms.SkinnedForm.SkinnedForm_Resize (System.Object sender,
+tArgs e) [0x00000]
+  at (wrapper delegate-invoke)
+Args (object,System.EventArgs)
+  at System.Windows.Forms.Control.OnResize (System.EventArgs e) [0x00028]
+in C:\
+  at System.Windows.Forms.Form.OnResize (System.EventArgs e) [0x00000] in
+  at System.Windows.Forms.Control.OnSizeChanged (System.EventArgs e)
+[0x00006] i
+  at System.Windows.Forms.Control.UpdateBounds (Int32 x, Int32 y, Int32
+width, I
+nt32 height, Int32 clientWidth, Int32 clientHeight) [0x000ec] in
+  at System.Windows.Forms.Control.UpdateBounds (Int32 x, Int32 y, Int32
+width, I
+nt32 height) [0x0002e] in
+  at System.Windows.Forms.Control.SetBoundsCore (Int32 x, Int32 y, Int32 width,
+Int32 height, BoundsSpecified specified) [0x0004a] in
+  at System.Windows.Forms.Form.SetBoundsCore (Int32 x, Int32 y, Int32
+width, Int
+32 height, BoundsSpecified specified) [0x00000] in
+  at System.Windows.Forms.Control.SetBounds (Int32 x, Int32 y, Int32 width,
+2 height, BoundsSpecified specified) [0x00048] in
+  at System.Windows.Forms.Control.set_Height (Int32 value) [0x00000] in
+  at SnapForms.MessageWindow..ctor (SnapForms.SkinnedForm _parent) [0x00000]
+  at (wrapper remoting-invoke-with-check) SnapForms.MessageWindow:.ctor
+  at SnapForms.Program.Main () [0x00000]

More information about the mono-bugs mailing list