SiberianGuy
SiberianGuy

Reputation: 25312

Make screenshot of url

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

Answers (4)

Ken Brittain
Ken Brittain

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

gideon
gideon

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: enter image description here

Upvotes: 1

Yoshi
Yoshi

Reputation: 3405

awesomium is made for this

Upvotes: 3

Yaroslav Bigus
Yaroslav Bigus

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

Related Questions