日期:2014-05-18 浏览次数:20432 次
String ImagePath="图片路径";//如果用的是Url虚拟路径,用Server.MapPath转换成物理路径 Bitmap image=new Bitmap(Image.FromFile(ImagePath)); System.IO.MemoryStream ms = new System.IO.MemoryStream(); image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); HttpContext.Current.Response.ClearContent(); HttpContext.Current.Response.ContentType = "image/Jpeg"; HttpContext.Current.Response.BinaryWrite(ms.ToArray());
------解决方案--------------------