[Mono-devel-list] System.Drawing.RectangleF problem

Aaron Forrest aaron at ultramoderne.net
Sat Oct 2 10:50:54 EDT 2004


The attached file compiles but then gives the following error when i run it:

aaron at newark:~/programming/mono$ ./DrawString.exe
Unhandled Exception: 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 <0x00090> System.Drawing.Graphics:DrawString 
(string,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Drawing.StringFormat)
in <0x00108> (wrapper remoting-invoke-with-check) 
System.Drawing.Graphics:DrawString 
(string,System.Drawing.Font,System.Drawing.Brush,System.Drawing.RectangleF,System.Drawing.StringFormat)
in <0x00160> DrawText:.ctor (string)
in <0x000ad> DrawText:Main ()

Is this a bug in the System.Graphics.DrawString () method which uses a 
formatting rectangle or is it an error in my code?  So long as I don't 
use a RectangleF for formatting it works just fine.
Thanks
aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DrawString.cs
Type: text/x-csharp
Size: 1192 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20041002/fc75430f/attachment.bin 


More information about the Mono-devel-list mailing list