title: Trying to make a zoom effect
body: <p>I am trying to make a zoom effect on a picturebox with mouse wheel. Everything is OK except that when I use mouse middle button to zoom in or zoom out, it is ok, but it does not zoom in or zoom out the point which the mouse cursor is on. When I zoom in the point, I want it always slide. Please help me add a code snippet to make it work.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>int i = 5;
  int index = 10;
  private double[] zoomfactor = { .25, .33, .50, .66, .80, 1, 1.25, 1.5, 2.0, 2.5, 3.0 };
  
  private void Zoom(int i)
  {
  
    double new_Zoom = zoomfactor[i];
  
    imgBox.Width = Convert.ToInt32(imgBox.Image.Width * new_Zoom);
    imgBox.Height = Convert.ToInt32(imgBox.Image.Height * new_Zoom);
  
  }
  
  private void On_wheel(object sender, System.Windows.Forms.MouseEventArgs e)
  {
    i = i + e.Delta / 120;
    if (i &lt; 0)
    {
      i = 0;
    }
    else
    {
      if (i &lt;= index)
        i = i;
      else
        i = index;
     }
     Zoom(i);
  }
  </code></pre>