C# 保存高质量bitmap到本地
//获得JPEG格式的编码器 ImageCodecInfo myImageCodecInfo = GetEncoderInfo("image/jpeg"); //设置质量 数字越大质量越好,但是到了一定程度质量就不会增加了,MSDN上没有给范围,只说是32为非负整数 EncoderParameters myEncoderParameters = new EncoderParameters(1) { Param=new EncoderParameter[] { new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 100L) } }; Bitmap.Save(filePath, myImageCodecInfo, myEncoderParameters); private ImageCodecInfo GetEncoderInfo(String mimeType) { int j; ImageCodecInfo[] encoders; encoders = ImageCodecInfo.GetImageEncoders(); for (j = 0; j < encoders.Length; ++j) { if (encoders[j].MimeType == mimeType) return encoders[j]; } return null; }