By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,952 Members | 1,858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,952 IT Pros & Developers. It's quick & easy.

Save picturebox's image to stream

P: n/a
I got the error
An unhandled exception of typ
'System.Runtime.InteropServices.ExternalException' occurred i

Additional information: A generic error occurred in GDI+

the code like this

Image aImg = pictrebox1.Image
MemoryStream ms = new MemoryStream()

Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
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

Answer those GDI+ questions with the GDI+ FAQ

The GDI+ FAQ RSS feed:
Windows Forms Tips and Tricks RSS:
Bob's Blog:

"Alexli" <an*******> wrote in message
I got the error:
An unhandled exception of type
'System.Runtime.InteropServices.ExternalException' occurred in

Additional information: A generic error occurred in GDI+.

the code like this:

Image aImg = pictrebox1.Image;
MemoryStream ms = new MemoryStream();

Nov 16 '05 #2

P: n/a
I have tried bmp and jpeg, got same error
Nov 16 '05 #3

P: n/a
"Alexli" wrote :
I have tried bmp and jpeg, got same error

I tried your code and it worked for me.

Where does your Image come from ?
Have you tried with another picture ?
What happen if you try the same thing in a new project ?

Francois Beaussier
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.