[Mono-list] Unspecific error: System.Exception: Generic Error [GDI+ status: GenericError]

Yves Goergen nospam.list at unclassified.de
Tue Oct 26 17:34:34 EDT 2010


I'm writing an application that shall generate graph images and save
them in a PNG file. I'm writing and compiling the code with Visual
Studio 2005 on Windows and running it on Ubuntu Linux 10.4 with Mono
2.4.4. Here's the error message I get:

> Unhandled Exception: System.Exception: Generic Error [GDI+ status: GenericError]
>   at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] 
>   at System.Drawing.Image.Save (System.String filename, System.Drawing.Imaging.ImageCodecInfo encoder, System.Drawing.Imaging.EncoderParameters encoderParams) [0x00000] 
>   at System.Drawing.Image.Save (System.String filename, System.Drawing.Imaging.ImageFormat format) [0x00000] 
>   at (wrapper remoting-invoke-with-check) System.Drawing.Image:Save (string,System.Drawing.Imaging.ImageFormat)

And here's the offending code:

> Bitmap bmp = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
> string fileName = "graph.png";
> // Drawing stuff
> bmp.Save(fileName, ImageFormat.Png);

I don't understand the error message. What has happened? Is it my fault
or is Mono broken? I had other exceptions before that I could resolve by
installing more packages, most recently libgdiplus.

Yves Goergen "LonelyPixel" <nospam.list at unclassified.de>
Visit my web laboratory at http://beta.unclassified.de

More information about the Mono-list mailing list