I am creating a small simulation in VB and wish to
incorporate several animated GIFS. I can load the GIFS
from the hard drive into a picture box and they animate,
but I have two questions.
1.) Some of the GIFS were designed to play once, but in
my VB application they loop continuously. What must I do
to make them play only once?
2.) When I build the solution for distribution, how do I
incorporate the GIFS in the distribution package and
reference them? My first pass program used an ImageList,
but the GIFS would not animate.
Here is the code that I'm using to load the GIFS and
display them in a pictureBox.
Dim dPic(7) As Image
Dim FStr As String = "C:\Documents\Visual Studio _
Projects\ThreeD\bin\Gifs\"
dPic(0) = Image.FromFile(FStr + "D1.gif")
dPic(1) = Image.FromFile(FStr + "D1S.gif.")
dPic(2) = Image.FromFile(FStr + "D2.gif")
dPic(3) = Image.FromFile(FStr + "D2S.gif")
dPic(4) = Image.FromFile(FStr + "D3.gif")
dPic(5) = Image.FromFile(FStr + "D3S.gif")
dPic(6) = Image.FromFile(FStr + "DDP.gif")
dPic(7) = Image.FromFile(FStr + "DWin.gif")
LoadPic(1, 0)
LoadPic(2, 2)
LoadPic(3, 4)
.....
Sub LoadPic(ByVal Dx As Integer, ByVal i As Integer)
Select Case Dx
Case 1
pbD1.Image = dPic(i)
pbD1.Tag = i
Case 2
pbD2.Image = dPic(i)
pbD2.Tag = i
Case 3
pbD3.Image = dPic(i)
pbD3.Tag = i
End Select
End Sub
Thanks, in advance for your advice council and wisdom.
GrandpaB