Results 1 to 2 of 2

Thread: Image from web to app

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2011
    Posts
    31

    Image from web to app

    Anybody can help me how to get this picture to my picture box in my form1?

    <ul>
    <li style="background: none repeat scroll 0&#37; 0% transparent;">
    <div class="serviceload">
    <img src="http://website/pic/10.png" alt=""> </div>
    </li>
    </ul>

    The problem with this picture is that it changes like every hour.
    So the name of the picture changes also to blabla.png or hello.png or 2.png

    I hope somebody has the time to help me out on this 1.

    Thanks

    I know i can do it like this:
    But this gives me only 1 picture.
    Code:
       Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            LoadWebImageToPictureBox(PictureBox1, "http://website/pic/10.png")
        End Sub
    
        Public Function LoadWebImageToPictureBox(ByVal pb _
      As PictureBox, ByVal ImageURL As String) As Boolean
    
            Dim objImage As MemoryStream
            Dim objwebClient As WebClient
            Dim sURL As String = Trim(ImageURL)
            Dim bAns As Boolean
    
            Try
                If Not sURL.ToLower().StartsWith("http://") _
                     Then sURL = "http://" & sURL
                objwebClient = New WebClient()
    
    
                objImage = New  _
                   MemoryStream(objwebClient.DownloadData(sURL))
                pb.Image = Image.FromStream(objImage)
                bAns = True
            Catch ex As Exception
    
                bAns = False
            End Try
    
            Return bAns
    
        End Function

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jul 2011
    Posts
    31

    Re: Image from web to app

    Anybody Can help me on this???

    Something like

    Picturebox1= serviceload

    Or is there a way to look if the picture is there and show it.

    For example today picture1.jpg is there and 2 morrow picture2.jpg is there and next day picture5.jpg

    So maybe to put all the links in my app and let it check if the links are there?

    Could that work?
    Last edited by MisterNine; Aug 19th, 2011 at 01:48 PM.

Tags for this Thread

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