I'm trying to put icons on a tab. I'm getting the icon from http://google.com/favicon.ico for now.
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.
Here's my code so far:
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;
This gives me the following error: