System.IO.MemoryStream ms = new System.IO.MemoryStream();
img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
Response.ContentType = "image/png";
Response.Clear();
ms.WriteTo(Response.OutputStream);
Response.End();
转载于:https://www.cnblogs.com/striiiiing/archive/2012/09/06/2674146.html