The error probably comes from the fact that the image has no raw format.
save it as a bitmap, tiff or jpeg.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Image transition effects, automatic persistent configuration and
design time mouse operations all in April's issue of Well Formed
http://www.bobpowell.net/wellformed.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm
The GDI+ FAQ RSS feed:
http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS:
http://www.bobpowell.net/tipstricks.xml
Bob's Blog:
http://royo.is-a-geek.com/siteFeeder...aspx?FeedId=41
"Alexli" <an*******@discussions.microsoft.com> wrote in message
news:AB**********************************@microsof t.com...
I got the error:
==================
An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in
system.drawing.dll
Additional information: A generic error occurred in GDI+.
==================
the code like this:
Image aImg = pictrebox1.Image;
MemoryStream ms = new MemoryStream();
aImg.Save(ms,aImg.RawFormat);