Web site screenshot with ASP.NET 2.0

By Daron Yondem: 

Introduction
Moslty in site directory web sites there is a need to have the thumbnail image of each web site. Of course this feature can be needed in a wide range of projects handling with high amount of web sites.

Capturing screenshots with Windows application are very easy but how to capture a web sites screenshot? Imagine we load the given web site in our application and take a screenshot of it. To load the needed web site we can use WebBrowser component of .NET Framework 2.0 and use .DrawToBitmap method to get a bitmap picture of current web site. The scenario works well in Windows applications but how we do this in a web site?

The Idea
Never forget that ASP.NET and Windows Forms applications are all about .NET Framework. So theoretically we can do all the things in an ASP.NET application like we do in Windows Forms. The idea behind our solution will be to initialize a hidden WebBrowser component and load our web site inside it to be able to get screenshot. Of course we will fight against many further problem.

Read more...

No Comments