0

I have a WinForms picturebox with the Picture Size Mode set to StretchImage. I need the picturebox to zoom in by 1% every two milliseconds which will use a loop.

The pictureBox must zoom in at the center and scrollbars should not be shown.

This is my current code that doesn't work:

while (Visible) {
    pictureBox1.Width = pictureBox1.Width + 1;
    pictureBox1.Height = pictureBox1.Height + 1;
    Application.DoEvents();
    System.Threading.Thread.Sleep(2);
}

In this code, there is a window, but the image does not move in any way. How should this problem be implemented?

Heng Ye
  • 341
  • 4
  • 17

0 Answers0