Results 1 to 2 of 2

Thread: loadpicture from web?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    the UK
    Posts
    265

    loadpicture from web?

    Is it possible to use loadpicture with an image on the web?

    eg:

    Code:
    pic1.Picture = LoadPicture("http://www.somewebsite.com/somepicture.gif")
    Simon

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    No. You would have to download the picture to your HDD first, then load it.
    VB Code:
    1. 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
    2. Private Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    3.     Dim lngRetVal As Long
    4.     lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
    5.     If lngRetVal = 0 Then DownloadFile = False
    6. End Function
    7.  
    8. Sub Form_Load()
    9. DownloadFile "http://www.somewebsite.com/somepicture.gif", App.Path & "\somepicture.gif"
    10. Picture.Picture = LoadPicture(App.Path & "\somepicture.gif")
    11. End Sub

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width