//先设置图片框属性
pictureBox1-Anchor-Top, Bottom, Left, Right
pictureBox1-BackgroundImage-Zoom
//然后设置图片框鼠标事件
private void pictureBox1_MouseWheel(object sender, MouseEventArgs e)
{
int l = pictureBox1.Left;
int p = pictureBox1.Top;
int w = pictureBox1.Size.Width;
int h = pictureBox1.Size.Height;
var t = pictureBox1.Size;
t.Width += e.Delta;
t.Height += e.Delta;
pictureBox1.Size = t;//图片大小发生变化
//图片按当前位置缩放
int w1 = w - pictureBox1.Size.Width;
int h1 = h - pictureBox1.Size.Height;
pictureBox1.Location = new Point(l+w1/2,p+h1/2);//图片位置发生变化
}
//鼠标移动
int xPos;
int yPos;
bool MoveFlag;
priva