Private Sub UserForm_Initialize()
WebBrowser1.Navigate "http://www.animationplayhouse.com/25.gif"
End Sub
Private Sub CenterGif()
Dim PtX As Single, PtY As Single, DOC As Object, IMG As Object
On Error GoTo Err_CenterGif
LockWindowUpdate FindWindow(vbNullString, Me.Caption)
Set DOC = WebBrowser1.Document
PtX = 72 / DOC.parentWindow.screen.logicalXDPI
PtY = 72 / DOC.parentWindow.screen.logicalYDPI
Set IMG = DOC.images(0)
DOC.body.Style.backgroundColor = VBColorToHTML(WebBrowser1.Parent.BackColor)
IMG.Style.backgroundColor = DOC.body.Style.backgroundColor
WebBrowser1.Move -(IMG.offsetLeft * PtX), -(IMG.offsetTop * PtY)
Frame1.Move , , IMG.Width * PtX, IMG.Height * PtY
Frame1.Move (Me.InsideWidth - Frame1.Width) / 2, (Me.InsideHeight - Frame1.Height) / 2
Err_CenterGif:
LockWindowUpdate False
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
CenterGif
End Sub
Private Function VBColorToHTML(ByVal Color As Long) As String
Dim tmp As String
tmp = Right$("00000" & Hex$(Color), 6)
VBColorToHTML = "#" & Right$(tmp, 2) & Mid$(tmp, 3, 2) & Left$(tmp, 2)
End Function