Add a link 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; }
heisenberg
source share