M
marfi95
I have an animated gif playing fine in a picture box. However, I don't
want it to keep looping, I only want to play it twice. I found some
code that gets the active frame and loads it looping through, but I
cant get it to work. With this code, it didn't do any animation.
I found this:
For f = 0 To animatedGif.GetFrameCount(frameDimension) - 1
animatedGif.SelectActiveFrame(frameDimension, f)
Dim memoryStream As New System.IO.MemoryStream
animatedGif.Save(memoryStream,
System.Drawing.Imaging.ImageFormat.Bmp)
PictureBox2.Image =
System.Drawing.Image.FromStream(memoryStream)
Application.DoEvents()
Threading.Thread.CurrentThread.Sleep(100)
Next
TIA,
Mark
want it to keep looping, I only want to play it twice. I found some
code that gets the active frame and loads it looping through, but I
cant get it to work. With this code, it didn't do any animation.
I found this:
For f = 0 To animatedGif.GetFrameCount(frameDimension) - 1
animatedGif.SelectActiveFrame(frameDimension, f)
Dim memoryStream As New System.IO.MemoryStream
animatedGif.Save(memoryStream,
System.Drawing.Imaging.ImageFormat.Bmp)
PictureBox2.Image =
System.Drawing.Image.FromStream(memoryStream)
Application.DoEvents()
Threading.Thread.CurrentThread.Sleep(100)
Next
TIA,
Mark