I am creating a WinForm application that takes a photo of a person using a webcam, and I am trying to create a countdown effect. I have 4 images that I would like to skip, but it's pretty hard to do.
I use a timer for seconds, but everything that happens is this application is a little behind and then shows the last image. Does anyone know how I can do this?
Here is my code:
int counter = 0; // start the counter to swap the images tmCountDown.Start(); while (counter < 4) { // holding off picture taking } // reset counter for timer counter = 0; tmCountDown.Stop(); /// <summary> /// timer event to switch between the countdown images /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tmCountDown_Tick(object sender, EventArgs e) { counter++; //MessageBox.Show("c:/vrfid/apppics/" + counter + ".jpg"); pbCountDown.Image = new Bitmap("c:/vrfid/apppics/" + counter + ".jpg"); }
source share