[Mono-aspnet-list] GDI+ status: InvalidParameter on a WebService Method
BadStorm
mailinglist at slashweb.it
Fri Sep 14 20:20:44 UTC 2012
Hi,
I'm developing a web service in mono, and I have a little problem with one function:
One of my methods return an image. To do so I get data from the database and I do the following for convert it in base64 string:
MemoryStream ms = new MemoryStream(club_logo);
System.Drawing.Image myImage = System.Drawing.Image.FromStream(ms);
using (MemoryStream ms2 = new MemoryStream())
{
// Convert Image to byte[]
myImage.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
byte[] imageBytes = ms2.ToArray();
// Convert byte[] to Base64 String
string base64String = Convert.ToBase64String(imageBytes);
return base64String;
}
But I get this exception on this line "System.Drawing.Image myImage = System.Drawing.Image.FromStream(ms);" :
System.ArgumentException: A null reference or invalid value was found [GDI+ status: InvalidParameter]
at System.Drawing.GDIPlus.CheckStatus (Status status) [0x00000] in <filename unknown>:0
What does it means?
I used MonoDevelop 3 on MacOsX and I deployed it on an Ubuntu Server 12.04 whit Mono 2.10.8.1.
Thanks
Marco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20120914/fda4c72f/attachment-0001.html>
More information about the Mono-aspnet-list
mailing list