0

I want to generate screenshots of a website using its URL.

This I want to create using ASP.NET and C#, and I dont want to use any of the available tools and API(Url2Png, Wesnappr, Awesomium etc..).

Which classes of ASP.NET and C# should I explore for this ? How should I start about on this ?

Please can someone guide me on this.

Yasser Shaikh
  • 46,934
  • 46
  • 204
  • 281

1 Answers1

0

Looks like fun project to do by hand...

  • Read W3C site for HTML and CSS specifications (4+5 for HTML and 1+2+3 for CSS)
  • Implement your own HTML engine
  • Read ECMA specification to learn inner workings of JavaScript. Also dont forget to check for specific implementations for most popular browser(s) for you.
  • Implement your own JavaScript engine
  • Tie HTML and JavaScript engines togehter

Now when you have a way to safely render HTML on server it is an easy task: Get your engines to render page into a bitmap (may also need to implement cutom grapics library) and you are done.

More seriously - use existing tools (make sure they are ok to be used on server - i.e. I would not do it with IE engine). Or if you want to learn some particular part of the stack - scope the rest down (i.e. just render title of the page to bitmap using System.Drawing) to see how components work together.

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
  • Hi @Alexei Levenkov, thanks for posting this answer, can you explain this in a more simple manner ? – Yasser Shaikh Sep 08 '12 at 13:20
  • @Yasser, (it was not really serious suggestion...) The only way I can read "dont want to use any of the available tools" is "I want to build everything myslef" - so if you rally wanted to do so you'd have to read all I've linked and write(yearas of work). You probably mean something else based on your comment, but it is very hard to get what is inside ones head... – Alexei Levenkov Sep 08 '12 at 17:37