Change image in picturebox every second C#

后端 未结 5 1528
一整个雨季
一整个雨季 2021-01-13 13:08

I\'m creating a WinForm application that takes a person\'s photo with a webcam and am trying to now create a countdown effect. I have 4 images that i would like to cycle thr

5条回答
  •  抹茶落季
    2021-01-13 13:30

    Found a solution, no timer required. Thanks for the answers.

            int counter = 0;
            // start the counter to swap the images
            while (counter < 4)
            {
                // holding off picture taking
                counter++;
                //MessageBox.Show("c:/vrfid/apppics/" + counter + ".jpg");
                pbCountDown.Image = new Bitmap("c:/vrfid/apppics/" + counter + ".jpg");
                pbCountDown.Refresh();
                Thread.Sleep(1000);
            }
            // reset counter for timer
            counter = 0;
    

提交回复
热议问题