我想用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