用C#渲染html [英] rendering of html with C#

查看:303
本文介绍了用C#渲染html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c的帮助下渲染html文件



OP的附加文本从非解决方案移动

WebBrowser控件非常差,它使用IE的三叉戟渲染引擎

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

推荐答案

在Windows窗体中,使用Windows Forms WebBrowser控件 [ ^ ]

在WPF中,使用 WPF WebBrowser控件 [ ^ ]
In Windows Forms, use a Windows Forms WebBrowser control[^]
In WPF, use a WPF WebBrowser control[^]


您好,



最简单的解决方案是ProgramFox已经提到的WebBrowser控件,它非常适用于最需要的。



如果您不喜欢它,请查看 http:// awesomium .com / [ ^ ]



它建立在Webkit(Chrome或Safari)之上,如果您是小型企业或非盈利组织,它是免费的。



查看文档,这是显示页面的方式:



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





享受:)



Valery。



Enjoy :)

Valery.


唱歌(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();
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();


这篇关于用C#渲染html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆