Gibt ein Bild als Iage zurück, übergeben wird eine URL.
/// <summary>
/// Gets the image from URL.
/// </summary>
/// <param name="url">The URL.</param>
/// <returns></returns>
private static Image GetImageFromURL(string url)
{
HttpWebRequest httpWebRequest = (HttpWebRequest)HttpWebRequest.Create(url);
HttpWebResponse httpWebReponse = (HttpWebResponse)httpWebRequest.GetResponse();
Stream stream = httpWebReponse.GetResponseStream();
return Image.FromStream(stream);
}
3 Kommentare zum Snippet