可以先将图片下载到本地,再用LoadPicture加载到控件中显示。 在窗体中加入一个Image控件,然后代码:Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Longsub form_load() URLDownloadToFile 0, "http://图片路径", "C:\tmp.jpg", 0, 0 Image1.Picture = LoadPicture("C:\tmp.jpg") end sub
在窗体中加入一个Image控件,然后代码:Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Longsub form_load()
URLDownloadToFile 0, "http://图片路径", "C:\tmp.jpg", 0, 0
Image1.Picture = LoadPicture("C:\tmp.jpg")
end sub