时间:2021-11-04 10:01:47 | 栏目:.NET代码 | 点击:次
ImageCodecInfo[] icis = ImageCodecInfo.GetImageEncoders();
ImageCodecInfo ici = null;
foreach (ImageCodecInfo item in icis)
{
if (item.MimeType == "image/jpeg" || item.MimeType == "image/bmp" || item.MimeType == "image/png" || item.MimeType =="image/gif")
{
ici = item;
}
}
EncoderParameters ep = new System.Drawing.Imaging.EncoderParameters(1);
ep.Param[0] = new System.Drawing.Imaging.EncoderParameter(System.Drawing.Imaging.Encoder.Quality, (long)100);
resultImage.Save("D://jpg//test.jpg", ici, ep);
ep.Dispose();
resultG.Dispose();
resultImage.Dispose();
initImage.Dispose();
}
}