admin管理员组文章数量:1393035
I know that when you save an Image
you should provide a codec and encoding parameters, otherwise it might be saved with compression and etc.
So I can't understand why the following two code produces two different results:
System.Drawing.Image img1 = System.Drawing.Image.FromFile(imgPath);
System.Drawing.Image img2 = System.Drawing.Image.FromFile(imgPath);
img2.RotateFlip(RotateFlipType.RotateNoneFlipX);
var codec = ImageCodecInfo.GetImageEncoders().First(x => x.CodecName.Contains("Built-in PNG Codec"));
EncoderParameters ep = new EncoderParameters();
ep.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, (long)100);
img1.Save(@"C:\test1.png", codec, ep);
img2.Save(@"C:\test2.png", codec, ep);
The resulting test1.png
and test2.png
are of different size and compression. Why is that?
本文标签: cRotating image reduces sizedespite codec and encoding parametersStack Overflow
版权声明:本文标题:c# - Rotating image reduces size, despite codec and encoding parameters - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744681079a2619411.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论