i'm trying to load an image from a url
Picture1.Picture = LoadPicture("http://www.google.com/ig/images/weather/mostly_sunny.gif")
its not working
Printable View
i'm trying to load an image from a url
Picture1.Picture = LoadPicture("http://www.google.com/ig/images/weather/mostly_sunny.gif")
its not working
LoadPicture expects phisical file be present in the file system. With url you will need either download image first to local files system or use webbrowser control instead of picturebox.
how do you save an image
i kinda got it just have to fix the webbrowser now to look like a picture not a browser
About the other approach (downloading the image first) URLDownloadToFile API is a good way to do it:
Code: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 Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Private Sub Form_Load()
DownloadFile "http://e2.cdn.qnsr.com/OzoDB/v/w/20174349/V1/RIA_300x250_MangoVids.jpg", "c:\pic.jpg"
Me.Picture1.Picture = LoadPicture("c:\pic.jpg")
Kill "C:\pic.jpg"
End Sub
thanks that works good to