实现效果:
知识运用:
PictureBox控件的Height和Width属性
和PictureBox控件的SizeMode属性 //PictureBoxSizeMode枚举值
实现代码:
private void trackBar1_Scroll(object sender, EventArgs e) { try { pictureBox1.Width = (int)(trackBar1.Value * pictureBox1.Image.Width * -0.2); pictureBox1.Height = (int)(trackBar1.Value * pictureBox1.Image.Height * -0.2); } catch {} }