Image.FromStream : Image « System.Drawing « C# / C Sharp by API






Image.FromStream

 

using System;
using System.Net;
using System.IO;
using System.Drawing;
using System.Windows.Forms;

public class MainClass {
    public static void Main() {
        WebRequest requestPic = WebRequest.Create("http://www.your.com/1.jpg");
        WebRequest requestHtml = WebRequest.Create("http://www.your.com");

        WebResponse responsePic = requestPic.GetResponse();
        WebResponse responseHtml = requestHtml.GetResponse();

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

        using (StreamReader r = new StreamReader(responseHtml.GetResponseStream())) {
            Console.WriteLine(r.ReadToEnd());
        }
    }
}

   
  








Related examples in the same category

1.Image.FromFile(String path)
2.Image.GetThumbnailImage
3.Image.Height
4.Image.VerticalResolution
5.Image.RotateFlip(RotateFlipType.Rotate180FlipY)