Reputation: 25312
When user posts some url, I need to make screenshot of the url content. What .NET library can I use for that?
Upvotes: 1
Views: 423
Reputation: 2265
How about using the Selenium WebDriver? It works from .NET and is quite easy:
var browser = new InternetExplorerDriver();
browser.Navigate().GoToUrl("http://example.com");
browser.GetScreenshot().SaveAsFile(filename, ImageFormat.Png);
browser.Quit();
Upvotes: 2
Reputation: 19465
Just to mention another option, you could use thumbnail services like:
http://www.thumbalizr.com/
http://webshotspro.com
Thumalizr's sreenshot of this page looks decent and didn't take too long to generate:
Upvotes: 1
Reputation: 678
You can use System.Windows.Forms.WebBrowser for this purposes. You create WebBrowser instance. Then navigate to url and in OnDocumentComplete you can call DrawToBitmap method. Hope this helps you.
Upvotes: 1