Thursday, November 26, 2009

Get image from http URI to panel.Background

C# : // Create the requests.

WebRequest requestPic = WebRequest.Create(picUri);

WebResponse responsePic = requestPic.GetResponse();

Image webImage = Image.FromStream(responsePic.GetResponseStream());

pnlMapa.BackgroundImage = webImage;

VB.NET :

' Create the requests.

Dim requestPic As WebRequest = WebRequest.Create(picUri)

Dim responsePic As WebResponse = requestPic.GetResponse()

Dim webImage As Image =

Image.FromStream(responsePic.GetResponseStream())

pnlMapa.BackgroundImage = webImage


With those few line of code you can very fast get any

Internet image in your (application web or windows) :


0 comments:

Post a Comment

Locations of visitors to this page