467,926 Members | 1,596 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,926 developers. It's quick & easy.

Animated GIFS

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
Nov 21 '05 #1
  • viewed: 1370
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Shabam | last post: by
9 posts views Thread by John J. Hughes II | last post: by
2 posts views Thread by Koen Hoorelbeke | last post: by
2 posts views Thread by Scirious | last post: by
3 posts views Thread by ZikO | last post: by
4 posts views Thread by Jeff | last post: by
27 posts views Thread by Phil | last post: by
reply views Thread by helraizer1 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.