C#原图保存
bitPhoto.Save(Response.OutputStream, ImageFormat.Jpeg); 图像保存的问题,默认的质量是60% EncoderParameter p; EncoderParameters ps; ps = new EncoderParameters(1); p = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L); ps.Param[0] = p; ImageCodecInfo ii = GetCodecInfo("image/jpeg"); bitPhoto.Save(Response.OutputStream,ii,ps); private ImageCodecInfo GetCodecInfo(string mimeType) { ImageCodecInfo[] CodecInfo = ImageCodecInfo.GetImageEncoders(); foreach (ImageCodecInfo ici in CodecInfo) { if (ici.MimeType == mimeType) return ici; } return null; }
本文来自博客园,作者:jevan,转载请注明原文链接:https://www.cnblogs.com/DoNetCShap/p/14903482.html