This section helps to enlarge and reduce the image in the image window.
Add below code inside mouse event on mouse wheel.
if (e.Delta != 0) { if (e.Delta <= 0) { //set minimum size to zoom if (PictureBox1.Width < 50) return; } else { //set maximum size to zoom if (PictureBox1.Width > 500) return; } PictureBox1.Width += Convert.ToInt32(PictureBox1.Width * e.Delta / 1000); PictureBox1.Height += Convert.ToInt32(PictureBox1.Height * e.Delta / 1000); }
source share