|
-
Mar 13th, 2001, 06:59 PM
#1
Thread Starter
Member
How Can I Use A PictureBox Like This:
Picture1.Picture = "http://www.tha-nolia.com/image1.jpg"?
I Think I Might Dont Know The Answer To That One...
-
Mar 13th, 2001, 07:25 PM
#2
Why not just use a WebBrowser control?
Code:
WebBrowser1.Navigate "http://www.tha-nolia.com/image1.jpg"
-
Mar 13th, 2001, 11:43 PM
#3
Thread Starter
Member
I Dont Want To Use The WebBrowser Control, I Want Some API Code.
I Think I Might Dont Know The Answer To That One...
-
Mar 13th, 2001, 11:58 PM
#4
Use the URLDownloadToFile API function.
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
Private 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 Command1_Click()
Dim DF As Boolean
DF = DownloadFile("http://www.tha-nolia.com/image1.jpg", "c:\image1.jpg")
If DF = True Then
Picture1.Picture = LoadPicture("c:\image1.jpg")
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|