Results 1 to 6 of 6

Thread: [RESOLVED] image from url

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Resolved [RESOLVED] image from url

    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

  2. #2

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: image from url

    how do you save an image

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: image from url

    i kinda got it just have to fix the webbrowser now to look like a picture not a browser

  5. #5
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: image from url

    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

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: image from url

    thanks that works good to

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