Tylor
New member
Morning Guys.
I am currently trying to loop through images in a picturebox.
Somewhat to create an animation.
I'm currently using one picturebox that I just change the image from, and stop/restart the timer each time:
It does change the images, but at suck a fast speed even though my Timer is set to 1 second.
Is there a way to rectify this or is my code absolutely ugly to look at and I should scrap it and do something else instead. Like an array with switch cases?
I am currently trying to loop through images in a picturebox.
Somewhat to create an animation.
I'm currently using one picturebox that I just change the image from, and stop/restart the timer each time:
Timer1.Start() PictureBox1.Image = Image.FromFile("images.jpg") PictureBox1.Refresh() Timer1.Stop() Timer1.Interval = 1000 Timer1.Start() PictureBox1.Image = Image.FromFile("Image2.png") PictureBox1.Refresh() Timer1.Stop() Timer1.Interval = 1000 Timer1.Start() PictureBox1.Image = Image.FromFile("Image3.png") PictureBox1.Refresh() Timer1.Stop() Timer1.Interval = 1000 Timer1.Start() PictureBox1.Image = Image.FromFile("Image4.png") PictureBox1.Refresh() Timer1.Stop()
It does change the images, but at suck a fast speed even though my Timer is set to 1 second.
Is there a way to rectify this or is my code absolutely ugly to look at and I should scrap it and do something else instead. Like an array with switch cases?
Last edited by a moderator: