locked
Get Image from HTTP in a System.Drawing.Image RRS feed

  • Question

  • User-1103495211 posted

    How can i get a Image that exitsts on the WWW, into my project.
    Normally i get a image on this way:

     

            System.Drawing.Image ImgWatermerk = System.Drawing.Image.FromFile(PNGPath);

     

    But right now the image is remote like http://www.google.nl/google.jpg

     

    Tuesday, October 26, 2010 9:06 AM

Answers

All replies

  • User-609339402 posted

    Hi,

    For that you can refer this link

    http://www.java2s.com/Code/CSharp/2D-Graphics/ImageFromStreamloadimagefromstream.htm

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 26, 2010 9:56 AM
  • User-1752951588 posted

       System.Net.WebRequest img = System.Net.WebRequest.Create("http://www.google.nl/google.jpg");
            System.Net.WebResponse resImg = img.GetResponse();
            System.Drawing.Image ImgWatermerk = System.Drawing.Image.FromStream(resImg.GetResponseStream());

       System.Net.WebRequest img = System.Net.WebRequest.Create("http://www.google.nl/google.jpg");

            System.Net.WebResponse resImg = img.GetResponse();

            System.Drawing.Image ImgWatermerk = System.Drawing.Image.FromStream(resImg.GetResponseStream());

    Tuesday, October 26, 2010 10:52 AM