Convert a System.Drawing.Image to a stream

 
You can "Save" the image into a stream.
If you need a stream that can be read elsewhere, just create a MemoryStream:
var ms = new MemoryStream();
image.Save(ms, ImageFormat.Png);
// If you're going to read from the stream, you may need to reset the position to the start
ms.Position = 0;

Post a Comment

2 Comments