Click here to Skip to main content
15,885,856 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to render a html file with help of c#

OP's additional text moved from non-solution below
WebBrowser control is very poor, it's using trident rendering engine of IE
Posted
Updated 14-Nov-12 10:22am
v2
Comments
BillWoodruff 9-Nov-12 14:42pm    
Render in what: a C# Windows Form, a WPF Window ... ?

In Windows Forms, use a Windows Forms WebBrowser control[^]
In WPF, use a WPF WebBrowser control[^]
 
Share this answer
 
v2
Hello,

The easiest solution is the WebBrowser control that has already been mentioned by ProgramFox, it works very well for most needs.

If you do not like it, have a look at http://awesomium.com/[^]

It's built on top of Webkit (Chrome or Safari), it is free if you are a small business or for non-profit.

Looking at the documentation, this is how you display a page:

C#
using ( webView = WebCore.CreateWebView( 800, 600 ) )
{
    webView.Source = new Uri( "http://www.google.com" );

    while ( webView.IsLoadingPage )
        WebCore.Update();


    BitmapSurface surface = (BitmapSurface)view.Surface;
    surface.SaveToPNG( "result.png", true );
}

WebCore.Shutdown();


Enjoy :)

Valery.
 
Share this answer
 
sing ( webView = WebCore.CreateWebView( 800, 600 ) )
{
webView.Source = new Uri( "http://www.google.com" );

while ( webView.IsLoadingPage )
WebCore.Update();


BitmapSurface surface = (BitmapSurface)view.Surface;
surface.SaveToPNG( "result.png", true );
}

WebCore.Shutdown();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900