Click to See Complete Forum and Search --> : [RESOLVED] convert picturebox.image to stream
popskie
Jul 29th, 2005, 09:32 PM
hi,
how to convert picturebox.image to stream?
popskie
MrPolite
Jul 31st, 2005, 08:41 PM
uh you asked a similar q in the other post. If you have an open stream and you want to save your image to that, Image.Save has an overloaded method that accepts a stream. As simple as that. For example:
add this on top of the code page:
using System.IO;
FileStream fs = File.Create("C:\\foo.jpg");
pictureBox1.Image.Save (fs, System.Drawing.Imaging.ImageFormat.Jpeg);
fs.Close();
popskie
Aug 1st, 2005, 02:35 AM
Mr Polite code is much easirer thanks.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.