跳到主要内容

VB6实现网络加载动态图有绶存

·

最简单的方法,在picturebox控件中添加gif格式图片
首先、需要注册,注册方法:在工程中选中“引用”→引用项目ActiveMovie Control type Libray→然后点击“确定”键即可。

1'转载请注明出处,红防安全网QQ:3925993
2Private pMC As FilgraphManager
3Private pVW As IVideoWindow
 1Private Sub Form_Load()
 2Set xPost = CreateObject("Microsoft.XMLHTTP")
 3xPost.Open "GET", "http://www.hkfx.net/img/scan.gif", 0
 4xPost.Send
 5Set sGet = CreateObject("ADODB.Stream")
 6sGet.Mode = 3
 7sGet.Type = 1
 8sGet.Open
 9sGet.Write (xPost.responseBody)
10sGet.SaveToFile App.Path & "\scan.gif", 2
11'------------------------------------------------------------------------------------
12Me.ScaleMode = 3
13Picture1.ScaleMode = 3
14'------------------------------------------------------------------------------------
15On Error Resume Next
16    Set pMC = New FilgraphManager
17    pMC.Stop
18    pMC.RenderFile ""
19    pMC.RenderFile App.Path & "\scan.gif"
20    Set pVW = pMC
21    pVW.WindowStyle = CLng(&H6000000)
22    pVW.Left = 0
23    pVW.Top = 0
24    pVW.Width = Picture1.ScaleWidth
25    pVW.Height = Picture1.ScaleHeight
26    pVW.Owner = Picture1.hWnd
27    pVW.MessageDrain = Picture1.hWnd
28    pMC.Run
29    Kill App.Path & "/scan.gif"
30End Sub
白日映照满天星
作者
白日映照满天星
订阅我频道让你站在上帝角度观察视野! QQ:3925993 有尝解决技术问题【备注你的问题】 🐑

阅读量:评论:
赞赏码图