RE:OCX para Gif animados ¿Donde?
*********************************************************
En general declaraciones
***********************************************************
Dim RepeatTimes&
Dim RepeatCount&
***********************************************************
Función de animar gil
***********************************************************
Sub LoadAniGif(xFile As String, xImgArray)
If Not IIf(Dir$(xFile) = "", False, True) Or xFile = "" Then
MsgBox "File not found.", vbExclamation, "File Error"
Exit Sub
End If
Dim F1, F2
Dim AnimatedGIFs() As String
Dim imgHeader As String
Static buf$, picbuf$
Dim fileHeader As String
Dim imgCount
Dim i&, j&, xOff&, yOff&, TimeWait&
Dim GifEnd
GifEnd = Chr(0) & "!ù"
AnimationTimer.Enabled = False
For i = 1 To xImgArray.Count - 1
Unload xImgArray(i)
Next i
F1 = FreeFile
On Error GoTo badFile:
Open xFile For Binary Access Read As F1
buf = String(LOF(F1), Chr(0))
Get #F1, , buf
Close F1
i = 1
imgCount = 0
j = (InStr(1, buf, GifEnd) + Len(GifEnd)) - 2
fileHeader = Left(buf, j)
i = j + 2
RepeatTimes& = Asc(Mid(fileHeader, 126, 1)) + (Asc(Mid(fileHeader, 127, 1)) * 256)
Do
imgCount = imgCount + 1
j = InStr(i, buf, GifEnd) + Len(GifEnd)