GertJannie
Programmer
Hi, is it possible to show a webimage in a picturebox?
Thx in advance.
Thx in advance.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
private Image GetImage(string sURL)
{
Stream str = null;
try
{
//Create a web request to the url containing the image
HttpWebRequest wReq = (HttpWebRequest)WebRequest.Create(sURL);
//optional: use only if you're using a proxy to connect to the internet
//wReq.Proxy = SetWebProxy();
//gets the response from the web request
HttpWebResponse wRes = (HttpWebResponse)(wReq).GetResponse();
//return the image stream from the URL specified earlier
str = wRes.GetResponseStream();
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}
if (str != null)
return Image.FromStream(str);
else
return null;
}