How to Make Full Size Snapshot of Webpage in C# .NET ?
This article shows you a solution for making full size snapshot of website page from URL.
- Step 1: Download the Websites Screenshot .Net DLL.
- Step 2: Install it on your computer. You will get the WebsitesScreenshot.dll component in the folder.
- Step 3: Open your visual studio project, add this dll in your project references and try the following sample code.
The following code sample shows you how to make full size PNG snapshot of the webpage from URL. You can also create the snapshot in JPG, GIF, BMP or TIFF. By passing the height or width you also make the small size thumbnail image. If you want to generate the full size snapshot of your local HTML page, pass the local html file in the CaptureWebpage function instead of URL.
C# .Net Code.
WebsitesScreenshot.WebsitesScreenshot _Obj; _Obj = new WebsitesScreenshot.WebsitesScreenshot (); WebsitesScreenshot.WebsitesScreenshot.Result _Result; _Result = _Obj.CaptureWebpage("http://www.WebsitesScreenshot.com"); if (_Result == WebsitesScreenshot.WebsitesScreenshot.Result.Captured) { _Obj.ImageFormat = WebsitesScreenshot. WebsitesScreenshot.ImageFormats.PNG; _Obj.SaveImage ("c:\\WebsitesScreenshot.png"); } _Obj.Dispose();
VB .Net code.
Dim _Obj As New WebsitesScreenshot.WebsitesScreenshot Dim _Result As WebsitesScreenshot.WebsitesScreenshot.Result With _Obj _Result = .CaptureWebpage("http://www.WebsitesScreenshot.com") If _Result = WebsitesScreenshot.WebsitesScreenshot. _ Result.Captured Then .ImageFormat = WebsitesScreenshot. _ WebsitesScreenshot.ImageFormats.PNG .SaveImage("c:\WebsitesScreenshot.png") End If End With _Obj.Dispose()