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();
}
}
新闻热点
疑难解答