Welcome Guest Search | Active Topics | Sign In | Register

Eo.WebBrowser in Arvixe. Unable to take screenshot Options
David
Posted: Tuesday, December 8, 2020 1:49:32 AM
Rank: Newbie
Groups: Member

Joined: 12/8/2020
Posts: 5
Hi.

I'm checking whether webbrowser works in Arvixe webhosting.
I want to take screenshot of a website (for example google), but it does not generate anything.

My code below;

Code: C#
private void test3()
        {
            string strTargetURL = "http://www.google.com";

            // Create a ThreadRunner object
            ThreadRunner threadRunner = new ThreadRunner();

            //Create a WebView through the ThreadRunner
            WebView webView = threadRunner.CreateWebView();

            threadRunner.Send(() =>
            {
                string strFile = Server.MapPath("~/test.jpg");

                //Load Google's home page
                webView.LoadUrlAndWait(strTargetURL);

                //Capture screens-hot and save it to a file
                webView.Capture().Save(strFile);
            });

            threadRunner.Dispose();
        }



The server return successfully, and the test.jpg file was generated. But when I open test.jpg, it is blank.
Any advise?
eo_support
Posted: Tuesday, December 8, 2020 3:59:10 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,071
Hi,

Your code looks correct and it worked properly when we tested it here. So we are not sure what's causing the problem for you. As a test, you can try to load other site or static HTML file to see if those are rendered/captured correctly.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.