By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,693 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,693 IT Pros & Developers. It's quick & easy.

Animated GIFS

P: n/a
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 _
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.
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.