×

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

hqy hqy 发表于2025-02-21 16:08:45 浏览5 评论0

抢沙发发表评论

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


Private pMC As FilgraphManager 3Private pVW As IVideoWindow
Private 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


打赏

本文链接:https://www.kinber.cn/post/4919.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客