title: C# Get icon from url as System.Drawing.Icon
body: <p>I'm trying to put icons on a tab. I'm getting the icon from
  <a href="http://google.com/favicon.ico" rel="nofollow noreferrer">http://google.com/favicon.ico</a> for now.</p>
  
  <p>I want to get the favicon.ico as System.Drawing.Icon. The original code I'm using is for a normal image, but I need it to be System.Drawing.Icon.</p>
  
  <p>Here's my code so far:</p>
  
  <pre><code>var iconURL = "http://" + url.Host + "/favicon.ico";
  
  System.Drawing.Icon img = null;
  WebRequest request = WebRequest.Create(iconURL);
  WebResponse response = request.GetResponse();
  
  using (Stream stream = response.GetResponseStream())
  {
      img = new System.Drawing.Icon(stream);
      // then use the image
  }
  
  qTabControl1.ActiveTabPage.Icon = img;
  </code></pre>
  
  <p>This gives me the following error:</p>
  
  <p><a href="https://i.stack.imgur.com/mA8vj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mA8vj.png" alt="enter image description here"></a></p>