string mappath = Server.MapPath("~/TestData/test.jpg"); //Server.MapPath("~/images/CommImages") + "\\"; Bitmap bitmap = new Bitmap(mappath); using (MemoryStream ms = new MemoryStream()) { // Send the encoded image to the browser Response.BufferOutput = false; // to prevent buffering HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ClearHeaders(); HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=USPSTest.jpg"); HttpContext.Current.Response.ContentType = "image/jpeg"; bitmap.SetPixel(10, 10, Color.Red); bitmap.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg); } bitmap.Dispose();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)