Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Carmine

    Help

    Hi NG,
    I need your help to solve this problem:
    In a form I have located a blank pictureBox. I don't know before some
    events which image I need to show in the picturebox and at the same
    time I don't know the list of the images...but I know only the url of
    the images! Now, Is it possible to show in the picturebox images using
    the url?

    thanks in advance
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Help

    Carmine,

    You should be able to do this. What you want to do is get a class that
    derives from WebRequest using the static CreateMethod on the WebRequest
    class. With the request, you can call the GetResponse method, and get a
    class that derives from WebResponse. Once you have that, you can call the
    GetResponseStre am method to get a Stream that has the image data (assuming
    that the image is what is being passed to you and not a page with the image
    in it). Finally, call the static FromStream method on the Image class,
    passing in the Stream that is returned from the call to GetResponseStre am,
    and then set the PictureBox's Image property to the Image that is returned.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "Carmine" <bladeone@katam ail.com> wrote in message
    news:bc9c4fbf.0 312291159.d02d4 12@posting.goog le.com...[color=blue]
    > Hi NG,
    > I need your help to solve this problem:
    > In a form I have located a blank pictureBox. I don't know before some
    > events which image I need to show in the picturebox and at the same
    > time I don't know the list of the images...but I know only the url of
    > the images! Now, Is it possible to show in the picturebox images using
    > the url?
    >
    > thanks in advance[/color]


    Comment

    Working...