Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Image in picture box 3

Status
Not open for further replies.

NerdTop72

Programmer
Mar 14, 2005
117
US
Im trying to display an image from a website link to a picturebox.



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim Dopplerloc As String = " Me.PictureBox1.Image = New System.Drawing.Bitmap(Dopplerloc)
End Sub


I am trying to do this with on windows ce so the code seems to change from the vb.net 2005 code. there is no picturebox1.imagelocation or .refresh.

I get the error
"Value does not fall within the exected range" on the system.drawing.bitmap part

would there be an easier way to do download the image and cash it then display it in a picturebox?

I want to just add a timer to update the picturebox image every 5 minutes or so. i just cant figure out how to get the image to display from the web
 
Hello,

I'm not sure if this would work but what if you created a stream from your link url and then created the image from the stream? Good Luck!
 
Thanks for the response I found this searching for stream url in this forum

Here is the code I am using to update a picturebox with a URL jpeg

Dim Request As HttpWebRequest
Request = WebRequest.Create(" Dim Response As WebResponse
Response = Request.GetResponse()
Dim str As IO.Stream = Response.GetResponseStream
Dim Pic As New Bitmap(str)
Me.PictureBox1.Image = (Pic)

Thanks for help!
 
Thank you both. SBendBuckeye for pointing in the right direction and NerdTop72 for posting how/what needed to be changed so I didn't have to figure it out. :) Stars.

-I hate Microsoft!
-Forever and always forward.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top