[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.

http://bugzilla.ximian.com/show_bug.cgi?id=81128

--- 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: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: mitcheloc at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+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:
+}
+else
+{
+    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
+referen
+ce or invalid value was found.
+  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0006d] in
+C:\cygwin\t
+mp\scratch\mono-1.2.3.1\mcs\class\System.Drawing\System.Drawing\gdipFunctions.cs
+:200
+  at System.Drawing.Image.get_PixelFormat () [0x0000e] in
+C:\cygwin\tmp\scratch\
+mono-1.2.3.1\mcs\class\System.Drawing\System.Drawing\Image.cs:617
+  at (wrapper remoting-invoke-with-check)
+System.Drawing.Image:get_PixelFormat (
+)
+  at SnapForms.SkinnedForm.GenerateBackground () [0x00000]
+  at SnapForms.SkinnedForm.SkinnedForm_Resize (System.Object sender,
+System.Even
+tArgs e) [0x00000]
+  at (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_Event
+Args (object,System.EventArgs)
+  at System.Windows.Forms.Control.OnResize (System.EventArgs e) [0x00028]
+in C:\
+cygwin\tmp\scratch\mono-1.2.3.1\mcs\class\Managed.Windows.Forms\System.Windows.F
+orms\Control.cs:5291
+  at System.Windows.Forms.Form.OnResize (System.EventArgs e) [0x00000] in
+C:\cyg
+win\tmp\scratch\mono-1.2.3.1\mcs\class\Managed.Windows.Forms\System.Windows.Form
+s\Form.cs:1782
+  at System.Windows.Forms.Control.OnSizeChanged (System.EventArgs e)
+[0x00006] i
+n
+C:\cygwin\tmp\scratch\mono-1.2.3.1\mcs\class\Managed.Windows.Forms\System.Wind
+ows.Forms\Control.cs:5305
+  at System.Windows.Forms.Control.UpdateBounds (Int32 x, Int32 y, Int32
+width, I
+nt32 height, Int32 clientWidth, Int32 clientHeight) [0x000ec] in
+C:\cygwin\tmp\s
+cratch\mono-1.2.3.1\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Control
+.cs:4311
+  at System.Windows.Forms.Control.UpdateBounds (Int32 x, Int32 y, Int32
+width, I
+nt32 height) [0x0002e] in
+C:\cygwin\tmp\scratch\mono-1.2.3.1\mcs\class\Managed.W
+indows.Forms\System.Windows.Forms\Control.cs:4274
+  at System.Windows.Forms.Control.SetBoundsCore (Int32 x, Int32 y, Int32 width,
+Int32 height, BoundsSpecified specified) [0x0004a] in
+C:\cygwin\tmp\scratch\mono
+-1.2.3.1\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Control.cs:4146
+  at System.Windows.Forms.Form.SetBoundsCore (Int32 x, Int32 y, Int32
+width, Int
+32 height, BoundsSpecified specified) [0x00000] in
+C:\cygwin\tmp\scratch\mono-1.
+2.3.1\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Form.cs:1940
+  at System.Windows.Forms.Control.SetBounds (Int32 x, Int32 y, Int32 width,
+Int3
+2 height, BoundsSpecified specified) [0x00048] in
+C:\cygwin\tmp\scratch\mono-1.2
+.3.1\mcs\class\Managed.Windows.Forms\System.Windows.Forms\Control.cs:3689
+  at System.Windows.Forms.Control.set_Height (Int32 value) [0x00000] in
+C:\cygwi
+n\tmp\scratch\mono-1.2.3.1\mcs\class\Managed.Windows.Forms\System.Windows.Forms\
+Control.cs:2521
+  at SnapForms.MessageWindow..ctor (SnapForms.SkinnedForm _parent) [0x00000]
+  at (wrapper remoting-invoke-with-check) SnapForms.MessageWindow:.ctor
+(SnapFor
+ms.SkinnedForm)
+  at SnapForms.Program.Main () [0x00000]


More information about the mono-bugs mailing list