private void pictureEdit1_Properties_MouseWheel(object sender, MouseEventArgs e)
{
Rectangle oldrct;
Bitmap bmp;
bmp = (Bitmap)this.pictureEdit1.Image;
oldrct = new Rectangle(0, 0, bmp.Width, bmp.Height);
this.pictureEdit1.Image = bmp;
Bitmap tmpbmp = null;
int i = e.Delta;
if (i > 0)
{
tmpbmp = new Bitmap(bmp.Width * 2, bmp.Height * 2);
}
else
{
tmpbmp = new Bitmap(bmp.Width / 2, bmp.Height / 2);
}
Graphics g = Graphics.FromImage(tmpbmp);
Rectangle newrct = new Rectangle(0, 0, tmpbmp.Width, tmpbmp.Height);
g.DrawImage(bmp, newrct, oldrct, GraphicsUnit.Pixel);//newrct是你的目标矩形位置,oldrct是你原始图片的起始矩形位置
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
//oldrct = oldrct;
pictureEdit1.Image = tmpbmp;
g.Dispose();
pictureEdit1.Update();
}