List Info

Thread: Conversion Error




Conversion Error
user name
2007-01-05 14:22:34
I'm trying to convert a System.Byte[] into
System.Drawing.Image.  I've
included my code below.  When I execute
System.Drawing.Image.FromStream(ms)
I get the following error: System.ArgumentException: 
Parameter is not
valid.  Does anyone have an idea as to why this is throwing
an error?



public System.Drawing.Image ByteArrayToImage(Byte[]
byteArrayIn)

{

    MemoryStream ms = new MemoryStream(byteArrayIn);

    System.Drawing.Image returnImage =
System.Drawing.Image.FromStream(ms);

    return returnImage;

}



Thanks,



Shawn Hevel, API, AIT
Lead Programmer Analyst
Information Technology Department
South Carolina Farm Bureau Insurance Companies
Phone: (803) 936-4331
Fax: (803) 936-4629
Work Email: shawnhevelscfbins.com <mailto:ShawnHevelscfbins.com>
Home Email: hevelhousesc.rr.com




===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )