15
Possible Duplicate:
System.Drawing.Image to stream C#
how can I convert a System.Drawing.Image to a stream?
Possible Duplicate:
System.Drawing.Image to stream C#
how can I convert a System.Drawing.Image to a stream?
Add a reference to System.Drawing and include the following namespaces:
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
And something like this should work:
public Stream GetStream(Image img, ImageFormat format)
{
var ms = new MemoryStream();
img.Save(ms, format);
return ms;
}