Display the images into picture box every 1 second(VC#)

  • Thread starter Thread starter Dev
  • Start date Start date
D

Dev

Dear Friends,
I have 20 images in Array list.How do display the
images into picture box every 1 second.If anyone knows please let me
know....I don't want reload the form.The images are comming from network...
sample code or reference links are welcome....

Thanks,
Dev
 
Dear Cole Shelton ,
Thanks for you input..i am new to this...can you please send any sample code
or link..
Thanks,
Dev
 
Below is the gist of what you need. I will email you the form.

private void Form_HandleDestroyed(object sender, EventArgs e)
{
_HandleDestroyed = true;
}

private void Form_Load(object sender, EventArgs e)
{
// The ThreadStart class encapsulates the Thread handling method
ThreadStart ts = new ThreadStart(ThreadHandler);

// Create new Thread
Thread t = new Thread(ts);
t.Start();
}


private delegate void ChangePictureHandler();

private void ThreadHandler()
{
ChangePictureHandler cph = new ChangePictureHandler(ChangePicture);
// Do while form is not disposed
while (!_HandleDestroyed)
{
this.Invoke(cph);
Thread.Sleep(1000);
}
}

private void ChangePicture()
{
if (_CurrentPicIndex == imgList.Images.Count - 1)
{
_CurrentPicIndex = 0;
}
else
{
_CurrentPicIndex++;
}
picBox.Image = imgList.Images[_CurrentPicIndex];
}
 
Back
Top