Picture Boxes and the NET

Does anyone have any ideas, hot to assign a picture from the net to a picture box at run time?

At the moment, i can get it to display a gif located on the net, but only at design time via the image property on the properties tab. This works like a charm, but when i come to trying this at runtime, i get this message:

An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: URI formats are not supported.

Any ideas on this?

Comments

  • : Does anyone have any ideas, hot to assign a picture from the net to a picture box at run time?
    :
    : At the moment, i can get it to display a gif located on the net, but only at design time via the image property on the properties tab. This works like a charm, but when i come to trying this at runtime, i get this message:
    :
    : An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
    : Additional information: URI formats are not supported.
    :
    : Any ideas on this?
    :
    :



  • : : Does anyone have any ideas, hot to assign a picture from the net to a picture box at run time?
    : :
    : : At the moment, i can get it to display a gif located on the net, but only at design time via the image property on the properties tab. This works like a charm, but when i come to trying this at runtime, i get this message:
    : :
    : : An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
    : : Additional information: URI formats are not supported.
    : :
    : : Any ideas on this?
    : :
    : :
    :
    :
    :
    :

    Try something like ...

    picBox.Image = Image.FromFile("c:somepicture.bmp")
  • : : : Does anyone have any ideas, hot to assign a picture from the net to a picture box at run time?
    : : :
    : : : At the moment, i can get it to display a gif located on the net, but only at design time via the image property on the properties tab. This works like a charm, but when i come to trying this at runtime, i get this message:
    : : :
    : : : An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
    : : : Additional information: URI formats are not supported.
    : : :
    : : : Any ideas on this?
    : : :
    : : :
    : :
    : :
    : :
    : :
    :
    : Try something like ...
    :
    : picBox.Image = Image.FromFile("c:somepicture.bmp")
    :

    Yeah that what i was doing, the fromFile only works with local files, not URLs. But i have found a way around this, and now it works perfectly :) thanks anyways
  • : : : : Does anyone have any ideas, hot to assign a picture from the net to a picture box at run time?
    : : : :
    : : : : At the moment, i can get it to display a gif located on the net, but only at design time via the image property on the properties tab. This works like a charm, but when i come to trying this at runtime, i get this message:
    : : : :
    : : : : An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
    : : : : Additional information: URI formats are not supported.
    : : : :
    : : : : Any ideas on this?
    : : : :
    : : : :
    : : :
    : : :
    : : :
    : : :
    : :
    : : Try something like ...
    : :
    : : picBox.Image = Image.FromFile("c:somepicture.bmp")
    : :
    :
    : Yeah that what i was doing, the fromFile only works with local files, not URLs. But i have found a way around this, and now it works perfectly :) thanks anyways
    :

    Im pretty interested. What was your solution to the URL problem?


  • : : : : : Does anyone have any ideas, hot to assign a picture from the net to a picture box at run time?
    : : : : :
    : : : : : At the moment, i can get it to display a gif located on the net, but only at design time via the image property on the properties tab. This works like a charm, but when i come to trying this at runtime, i get this message:
    : : : : :
    : : : : : An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
    : : : : : Additional information: URI formats are not supported.
    : : : : :
    : : : : : Any ideas on this?
    : : : : :
    : : : : :
    : : : :
    : : : :
    : : : :
    : : : :
    : : :
    : : : Try something like ...
    : : :
    : : : picBox.Image = Image.FromFile("c:somepicture.bmp")
    : : :
    : :
    : : Yeah that what i was doing, the fromFile only works with local files, not URLs. But i have found a way around this, and now it works perfectly :) thanks anyways
    : :
    :
    : Im pretty interested. What was your solution to the URL problem?
    :
    :
    :

    Like so:

    Imports System.Net

    Dim wc As New WebClient()

    PictureBox1.Image = Image.FromStream(wc.OpenRead("URL"))

    I was looking at much more complicated solutions, and then i spotted the webclient class, and it works like a charm, there is a very small delay when retreiving the picture.

    Hope that helps
    -Fallen

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories