缩放图像时的差异

Differences when scaling images

我需要缩放图像,但在使用图形进行缩放时遇到问题。我使用 DrawImage,传递原始图像、新位置 (0, 0) 和新大小。结果图像已缩放,但其上边缘和左边缘是透明的。有人知道为什么吗? 我的代码:

Rectangle DstRec = new Rectangle(0, 0, (int) (CurrentImage.ImgBM.Width * Zoom), (int) (CurrentImage.ImgBM.Height * Zoom));
//ReducedBM = new Bitmap((int)(CurrentImage.ImgBM.Width * Zoom), (int)(CurrentImage.ImgBM.Height * Zoom));
ReducedBM = new Bitmap(CurrentImage.ImgBM, DstRec.Width, DstRec.Height);
Graphics g = Graphics.FromImage(ReducedBM);
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
//g.DrawImage(CurrentImage.ImgBM, 0, 0, (int)(CurrentImage.ImgBM.Width * Zoom), (int)(CurrentImage.ImgBM.Height * Zoom));
g.DrawImage(CurrentImage.ImgBM, DstRec);
g.Dispose();

我认为这条线有问题:

g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;

改成这个

g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;