How to Convert HTML to PNG in C# .NET ?

HTML to Image for .NET is a powerful .NET developer component that allows programmers to utilize automatic web page to image in any .NET supported language (ASP.NET, C#, VB). It converts website page into image of any type, including JPG, PNG, BMP, GIF and TIF. With our library developers can automatically take snapshots, generates webpage thumbnail and variety of powerful image capture and modification techniques for transforming html into image in their .NET projects.

Download HTML to Image for .NET and install it on your computer, with a few function calls, it takes the snapshots of given URLs as JPG, GIF, PNG, BMP and TIFF image, it helps you convert the web page to images in batch, capture full length website screenshots, generate thumbnail image previews of web pages.

Following code sample shows you how to convert web page to PNG buy passing your web page URL into CaptureWebpage function. Library can also convert local HTML files to image and HTML code to image. There are options to specify image format (JPG, PNG, BMP, GIF and TIFF), Image width, Image height and JPEG Quality.

C# .Net Code.

WebsitesScreenshot.WebsitesScreenshot _Obj;
_Obj = new WebsitesScreenshot.WebsitesScreenshot();
WebsitesScreenshot.WebsitesScreenshot.Result _Result;
_Result = _Obj.CaptureWebpage("");
if (_Result == WebsitesScreenshot.WebsitesScreenshot.Result.Captured)
	_Obj.ImageWidth = 200;
	_Obj.ImageHeight = 300;                
	_Obj.ImageFormat = WebsitesScreenshot.
			 WebsitesScreenshot.ImageFormats.PNG ;

VB .Net code.

Dim _Obj As New WebsitesScreenshot.WebsitesScreenshot()
Dim _Result As WebsitesScreenshot.WebsitesScreenshot.Result
With _Obj
	_Result = .CaptureWebpage("")
	If _Result = WebsitesScreenshot.WebsitesScreenshot _
				.Result.Captured Then
		.ImageWidth = 200
		.ImageHeight = 300
		.ImageFormat = WebsitesScreenshot. _
	End If
End With