[Mono-bugs] [Bug 58232][Nor] New - Graphics.DrawString nullpointer
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sat, 8 May 2004 05:52:03 -0400 (EDT)
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 pumrs@web.de.
http://bugzilla.ximian.com/show_bug.cgi?id=58232
--- shadow/58232 2004-05-08 05:52:03.000000000 -0400
+++ shadow/58232.tmp.10882 2004-05-08 05:52:03.000000000 -0400
@@ -0,0 +1,67 @@
+Bug#: 58232
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details: Suse 9.0
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Drawing.
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: pumrs@web.de
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Graphics.DrawString nullpointer
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Drawstring is not working in Graphics
+
+Steps to reproduce the problem:
+1. <%@ Page Language="C#" %>
+<HTML><HEAD><TITLE>CD-Verwaltung</title></head>
+<Body>
+<%@ Import Namespace="System.Drawing" %>
+<%@ Import Namespace="System.Drawing.Drawing2D" %>
+<%@ Import Namespace="System.Drawing.Imaging" %>
+<% Bitmap m_Bitmap; Graphics m_Graphic; Font m_Font;
+ m_Bitmap = new Bitmap(400,200);
+ m_Graphic = Graphics.FromImage(m_Bitmap);
+ SolidBrush m_b = new SolidBrush(Color.Green);
+ m_Graphic.FillRectangle(m_b,0,0,400,200);
+ m_b = new SolidBrush(Color.Red);
+ m_Font = new Font("Arial",20,FontStyle.Regular);
+ Response.Write(m_Font.ToString());
+ Response.Write("<BR>");
+ Response.Write(m_b.ToString());
+ m_Graphic.DrawString("Hugo",m_Font,m_b,50,60);
+ m_Bitmap.Save(Server.MapPath("temp/mytest.jpg"), ImageFormat.Jpeg);
+%>
+<img src="temp/mytest.jpg">
+2.
+3.
+
+Actual Results:
+System.NullReferenceException: Object reference not set to an instance of
+an object
+in (unmanaged) (wrapper managed-to-native)
+System.Drawing.GDIPlus:GdipDrawString
+(intptr,string,int,intptr,System.Drawing.RectangleF&,intptr,intptr)
+in <0x00004> (wrapper managed-to-native)
+System.Drawing.GDIPlus:GdipDrawString
+(intptr,string,int,intptr,System.Drawing.RectangleF&,intptr,intptr)
+in <0x000a3> System.Drawing.Graphics:DrawString
+(string,System.Drawing.Font,System.Drawing.Brush,single,single)
+
+
+Expected Results:
+no error
+
+How often does this happen?
+always
+
+Additional Information: