我想用C#裁剪图像,但我有一些问题。裁剪图像C#Distorion
我需要裁剪这张图片并从顶部15个像素:
我已经使用这个代码:
Bitmap myBitmap = new Bitmap(outputFileName);
Rectangle destRectangle = new Rectangle(new Point(0, 15),
new Size(myBitmap.Width, myBitmap.Height));
Bitmap bmp = new Bitmap(myBitmap.Width, myBitmap.Height - 15);
Graphics g = Graphics.FromImage(bmp);
g.DrawImage(myBitmap, 0, 0, destRectangle, GraphicsUnit.Pixel);
bmp.Save(outputFileNameCut, ImageFormat.Png);
这是第一个图像质量的变焦:
and this the second:
我怎样才能获得相同的图像质量?
这很完美。非常非常感谢你! – Ale
鉴于两种方法都有效,我想说第二种方法更有意义。改变插值模式和平滑将避免混叠,但问题是首先绘制它的缩放比例,这是不必要的 – Jcl