title: Download Image from byte stream c#
body: <p>I need to save the image from the URL <a href="https://lh3.googleusercontent.com/1yRnXjREIZ8wJ2ACfaAVyZGIuJDvLfNP-olu45HGAv8UtF3e7PL3T2bf2lEqHcT61nU=s180-rw" rel="nofollow noreferrer">link</a> and display it on UI then</p>
  
  <p>I tried all the approaches I was able to google for that purpose:</p>
  
  <pre><code> PictureBox pb = new PictureBox(); 
   pb.Load(imageUrl);
  </code></pre>
  
  <p>and</p>
  
  <pre><code>using (WebClient wc = new WebClient()) 
  {
          byte[] bytes = wc.DownloadData(imageUrl);
          MemoryStream ms = new MemoryStream(bytes);
          Image img = Image.FromStream(ms); 
  }
  </code></pre>
  
  <p>and more...</p>
  
  <p>But unfortunately, I'm constantly getting <code>ArgumentExceptiom</code> "Parameter is not valid, no matter what way I use to convert byte stream to the <code>Image</code> </p>
  
  <p>P.S. You can open the link in browser -> it is public. </p>
  
  <p><strong>UPDATE</strong>:
  Issue was resolved by just removing <code>-rw</code> at the end of the link</p>