Click here to Skip to main content
11,414,619 members (68,989 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 9-Nov-12 7:59am
Edited 14-Nov-12 11:22am
Nelek70.7K
v2
Comments
BillWoodruff at 9-Nov-12 14:42pm
   
Render in what: a C# Windows Form, a WPF Window ... ?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

In Windows Forms, use a Windows Forms WebBrowser control[^]
In WPF, use a WPF WebBrowser control[^]
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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:

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 Smile | :)

Valery.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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();
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,160
1 OriginalGriff 7,487
2 Maciej Los 3,710
3 Abhinav S 3,298
4 Peter Leow 3,084


Advertise | Privacy | Mobile
Web01 | 2.8.150427.4 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100