[Mono-osx] System.Drawing problems with Mono 2.8.1

Chris Van Wyk Chris.VanWyk at mixtelematics.com
Sat Nov 20 13:00:24 EST 2010


Hi,

I have a similar problem with System.Drawing, stack trace below. Source
code available from
http://beta.codeproject.com/script/Articles/ViewDownloads.aspx?aid=16405
The app was compiling on 2.8

Thanks
Chris


Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
  at System.Drawing.Graphics.Dispose () [0x00025] in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/System.Drawing/Syst
em.Drawing/Graphics.cs:300
  at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:Dispose
()
  at System.Drawing.Bitmap..ctor (System.Drawing.Image original, Int32
width, Int32 height) [0x0001f] in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/System.Drawing/Syst
em.Drawing/Bitmap.cs:155
  at System.Drawing.Bitmap..ctor (System.Drawing.Image original) [0x00000]
in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor
(System.Drawing.Image)
  at System.Windows.Forms.Cursor.ToBitmap (Boolean xor, Boolean
transparent) [0x00303] in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/Managed.Windows.For
ms/System.Windows.Forms/Cursor.cs:653
  at System.Windows.Forms.Cursor.CreateCursor (System.IO.Stream stream)
[0x000d1] in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/Managed.Windows.For
ms/System.Windows.Forms/Cursor.cs:120
  at System.Windows.Forms.Cursor..ctor (System.Type type, System.String
resource) [0x00021] in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/Managed.Windows.For
ms/System.Windows.Forms/Cursor.cs:157
  at System.Windows.Forms.Cursors.get_SizeNWSE () [0x0001a] in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/Managed.Windows.For
ms/System.Windows.Forms/Cursors.cs:311
  at System.Windows.Forms.SizeGrip..ctor (System.Windows.Forms.Control
CapturedControl) [0x00006] in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/Managed.Windows.For
ms/System.Windows.Forms/SizeGrip.cs:47
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.SizeGrip:.ctor (System.Windows.Forms.Control)
  at System.Windows.Forms.ScrollableControl.CreateScrollbars () [0x000c2]
in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/Managed.Windows.For
ms/System.Windows.Forms/ScrollableControl.cs:1127
  at System.Windows.Forms.ScrollableControl..ctor () [0x000b0] in
/private/tmp/monobuild/build/BUILD/mono-2.8.1/mcs/class/Managed.Windows.For
ms/System.Windows.Forms/ScrollableControl.cs:318
  at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename
unknown>:0
  at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown>:0
  at FloodFill2.Form1..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) FloodFill2.Form1:.ctor ()
  at FloodFill2.Program.Main () [0x00005] in
/Users/chris/Projects/queuelinearfloodfill_src/FloodFill2/Program.cs:16




On 2010/11/19 10:30 PM, "ChristianManthey" <info at manthey-it.de> wrote:

>
>Hi,
>
>i tried to run my application today with the current 2.8.1 framework on a
>G5
>and encountered some strange errors in the Systems.Drawing.Bitmap class.
>After some tests i decided to upgrade my own MacBook from 2.6.7 to the new
>version and ran into the same error.
>
>Object reference not set to an instance of an object
>  at System.Drawing.Graphics.Dispose () [0x00000] in <filename unknown>:0
>  at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:Dispose
>()
>  at System.Drawing.Bitmap..ctor (System.Drawing.Image original, Int32
>width, Int32 height) [0x00000] in <filename unknown>:0
>  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor
>(System.Drawing.Image,int,int)
>
>The function call was the following:
>newBitmap = new Bitmap(orgImage, iWidth, iHeight);
>This code is executed in a separate thread controlled by the main window
>thread.
>
>Now i tried to remove the 2.8.1 version (with the script from
>http://www.mono-project.com/Mono:OSX) and installed the old 2.6.7 version
>again, but now i do get a different error message...
>
>Generic Error [GDI+ status: GenericError]
>  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] in
><filename unknown>:0
>  at System.Drawing.Image.Save (System.String filename,
>System.Drawing.Imaging.ImageCodecInfo encoder,
>System.Drawing.Imaging.EncoderParameters encoderParams) [0x00000] in
><filename unknown>:0
>  at (wrapper remoting-invoke-with-check) System.Drawing.Image:Save
>(string,System.Drawing.Imaging.ImageCodecInfo,System.Drawing.Imaging.Encod
>erParameters)
>
>I also tried to use the 2.8 version but with no luck.
>
>Is there someone replaced with the 2.8.1 version that is not deleted with
>the script mentioned above and that is also not replaced with the 2.6.7
>version in the area of System.Drawing?
>
>Any help is highly appreciated!
>
>Kind regards,
>Christian
>--
>View this message in context:
>http://mono.1490590.n4.nabble.com/System-Drawing-problems-with-Mono-2-8-1-
>tp3050944p3050944.html
>Sent from the Mono - OSX mailing list archive at Nabble.com.
>_______________________________________________
>Mono-osx mailing list
>Mono-osx at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-osx


Read our disclaimer at http://www.mixtelematics.com/index.php?id=43874


More information about the Mono-osx mailing list