[Mono-bugs] [Bug 76103][Wis] New - Clipboard does not retrieve
bitmap as expected (Windows)
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Sep 14 11:25:03 EDT 2005
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 atsushi at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76103
--- shadow/76103 2005-09-14 11:25:03.000000000 -0400
+++ shadow/76103.tmp.28174 2005-09-14 11:25:03.000000000 -0400
@@ -0,0 +1,70 @@
+Bug#: 76103
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com
+ReportedBy: atsushi at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Clipboard does not retrieve bitmap as expected (Windows)
+
+The following code throws NullReferenceException under windows (at
+DataOBject.GetData()). This code expects a bitmap file "test.bmp" on the
+same directory (I put this test source under svn trunk/winforms/clipboard).
+
+--------
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+public class Test
+{
+ public static void Main ()
+ {
+ Prepare ();
+ Load ();
+ }
+
+ static void Prepare ()
+ {
+ Image bmp = Bitmap.FromFile ("test.bmp");
+ Clipboard.SetDataObject (new DataObject (DataFormats.Bitmap, bmp));
+ }
+
+ static void Load ()
+ {
+ Image img = (Image) Clipboard.GetDataObject ().GetData (DataFormats.Bitmap);
+ img.Save ("eno.bmp");
+ }
+}
+
+
+Actual Results:
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in [0x00016] (at C:\cygwin\home\atsushi\svn\winforms\clipboard\c.cs:23)
+Test:Load ()
+in [0x00005] (at C:\cygwin\home\atsushi\svn\winforms\clipboard\c.cs:10)
+Test:Main ()
+
+Expected Results:
+
+no exception.
+
+How often does this happen?
+
+consistently.
+
+Additional Information:
+
+Similarly if I have bitmap on clipboard, winforms/clipboard/clipboard.exe
+does not run fine (it seems trying to use disposed image handle), so I
+think something in XplatUIWin32 is the culprit.
More information about the mono-bugs
mailing list