1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
| private void independentResize(ref Bitmap OldImage, ref Bitmap NewImage, int Width, int Height) { if (Width != OldImage.Width || Height != OldImage.Height) { Rectangle oldRect = new Rectangle(0, 0, OldImage.Width, OldImage.Height); Rectangle newRect = new Rectangle(0, 0, Width, Height);
Graphics graphic = Graphics.FromImage(NewImage);
graphic.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; graphic.DrawImage(OldImage, newRect, oldRect, GraphicsUnit.Pixel); } else { NewImage = (Bitmap)OldImage.Clone(); } } |