Welcome Guest Search | Active Topics | Sign In | Register

Capture returns blank image on specific page Options
serializer
Posted: Friday, March 3, 2017 4:20:19 AM
Rank: Advanced Member
Groups: Member

Joined: 5/9/2016
Posts: 84
I am using the Capture method in the webView but on the link below it returns a white image:

http://bjorkhagsvagen3.se/photo/index.html?projectid=8d76a9b7-5aaa-49a3-a4f4-e5f2599f5c54

Any idea why?
eo_support
Posted: Friday, March 3, 2017 9:41:53 AM
Rank: Administration
Groups: Administration

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

This is just to let you know that we are able to reproduce the problem here. We do not know why yet. We will reply again when we have an update.

Thanks!
eo_support
Posted: Tuesday, March 7, 2017 9:53:54 AM
Rank: Administration
Groups: Administration

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

We have looked into this issue. The root of the problem is WebView.Capture does not support 3D accelerated output.

3D accleration is tighly integrated with screen buffers. So when the browser engine outputs to the screen, it can fully utilize 3D aceeleration interface (specifically, WebGL interface through Canvas object). However WebView.Capture uses off-screen rendering buffers, this limits its access to the 3D features provided by the display drivers. It could take the same route as the on-screen rendering but then it would be limited to what's on screen/screen size, which is not a good option either.

As such you may wish to look for if there are some option on the 3D JavaScript library you use to see if it can render without WebGL. To test whether it can render without WebGL, set the DisableGPU engine option to true. Please let us know if you need more help on that.

Thanks!
BenjaminSimpson1989
Posted: Tuesday, January 4, 2022 3:18:27 PM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
I'm getting the same blank capture with this URL in a windowless form:
https://www.sportscheck.com/therabody/therabody-theragun-elite-fitnessgeraet-p4793643be9c91c/color-black/
But it works when the form is not windowless. I already tried setting the DisableGPU engine option to true and putting in additional wait time before trying the capture.
eo_support
Posted: Wednesday, January 5, 2022 2:12:28 PM
Rank: Administration
Groups: Administration

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

We tested with the latest build and it seems to work fine. Our test code is as follow:

Code: C#
using (ThreadRunner tr = new ThreadRunner())
{
    WebView webView = tr.CreateWebView();
    tr.Send(() =>
    {
        webView.LoadUrlAndWait(url);
        webView.Capture().Save(result_file);
    });
    webView.Destroy();
}


Can you try the same code and see if it works for you?

Thanks!
BenjaminSimpson1989
Posted: Wednesday, January 5, 2022 7:49:42 PM
Rank: Advanced Member
Groups: Member

Joined: 1/12/2015
Posts: 81
That works but this still gives a blank image for the URL:
https://www.sportscheck.com/therabody/therabody-theragun-elite-fitnessgeraet-p4793643be9c91c/color-black/
Code: C#
using (ThreadRunner tr = new ThreadRunner())
{
    WebView webView = tr.CreateWebView();
    tr.Send(() =>
    {
        webView.Resize(1440, 900);
        webView.LoadUrlAndWait(url);
        webView.Capture().Save(result_file);
    });
    webView.Destroy();
}


It seems that the call to webView.Resize is somehow messing it up.
eo_support
Posted: Friday, January 7, 2022 11:18:54 AM
Rank: Administration
Groups: Administration

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

This is just to let you know that we are still working on this issue. We are able to reproduce the issue once we add webView.Resize. However we have not found out the root cause yet. We will reply here again as soon as we find anything.

In the mean time, you may want to use an on-screen WebView to perform the capture. Note that on-screen does not necessary mean visible. For example, you can change your code this way:

Code: C#
using (ThreadRunner tr = new ThreadRunner())
{
    WebView webView = tr.CreateWebView(1440, 900);
    tr.Send(() =>
    {
        webView.LoadUrlAndWait(url);
        webView.Capture().Save(result_file);
    });
    webView.Destroy();
}


The capture should work correctly because the WebView would be in on-screen mode. However the WebView is still invisible. The off-screen mode is meant to save more resources, however it appears that a large size triggers some kind of optimization/bypass in off-screen mode that caused the capture not working 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.