Save an HtmlElement Image to a file
-
I am searching for a way to save a HtmlElement to a file.
private void webBrowser1_DocumentCompleted(Object sender, WebBrowserDocumentCompletedEventArgs e) { HtmlElement he = webBrowser1.Document.Images[0]; }
Hint: the webBrowser1 itself has a function called DrawToBitmap that can be used to grab a thumbnail from a webpage.Bitmap docImage = new Bitmap(600, 800); webBrowser1.DrawToBitmap(docImage, new Rectangle(webBrowser1.Location.X, webBrowser1.Location.Y, webBrowser1.Width, webBrowser1.Height));
But i'm not sure how to do this with an image element inside my webpage. -
I am searching for a way to save a HtmlElement to a file.
private void webBrowser1_DocumentCompleted(Object sender, WebBrowserDocumentCompletedEventArgs e) { HtmlElement he = webBrowser1.Document.Images[0]; }
Hint: the webBrowser1 itself has a function called DrawToBitmap that can be used to grab a thumbnail from a webpage.Bitmap docImage = new Bitmap(600, 800); webBrowser1.DrawToBitmap(docImage, new Rectangle(webBrowser1.Location.X, webBrowser1.Location.Y, webBrowser1.Width, webBrowser1.Height));
But i'm not sure how to do this with an image element inside my webpage.