c#无法在webview中调整html内容的大小

时间:2017-11-30 04:26:19

标签: c# css webview

我在调整webview内容的大小时遇到​​了问题。目前,我在该计划中有以下代码。我正在使用awesomium:

public ClassroomGameWin ()
{
    if ((!WebCore.IsRunning) && (!initialized1))
    {
        WebCore.Initialize(WebConfig.Default);
       initialized1 = true;
    }

    InitializeComponent();
    wSession = WebCore.CreateWebSession(new WebPreferences() { CustomCSS = "body { transform: scale(1.6,1.6);}" });
    WebView newwindow = WebCore.CreateWebView(100, 100, wSession);

    InitializeView(newwindow);

    newwindow.Resize(300, 300);

    this.FormClosing += new FormClosingEventHandler(ClassroomGameWin_FormClosing);
    this.Load += new EventHandler(ClassroomGameWin_Load);            
    lock (lockObj)
    {
        forms.Add(this);
    }
}

: : :

internal ClassroomGameWin(WebView newwindow)
{
    InitializeComponent();
    InitializeView( newwindow );

    // We should immediately call a resize,
    // after wrapping child views.
    if (newwindow != null )
        newwindow.Resize( 300, 300 );
}

这是我面临的问题: 内容不会延伸到网络表单大小

enter image description here

关注调整大小而不是HTML源代码是否有办法解决问题?

0 个答案:

没有答案