Skip to content

Improve Screenshot API on Windows to allow for WebView screenshots #14825

@hsn-github

Description

@hsn-github

On Windows it is not possible to take a screenshot of the WebView with the code we have currently in the Screenshot API. We might want to consider adding some specialized code for it so that the consuming developer does not see any difference in public API, but the result will be the same.

For a workaround/code that needs to be implemented see this comment below.


Original issue:

    bool iscom=  webView.CaptureAsync().IsCompleted;
    var stream = await webView.CaptureAsync();
    using (var fileStream = new FileStream("image.png", FileMode.Create))
    {
        await stream.CopyToAsync(fileStream, ScreenshotFormat.Png, 100);
    }

This code is working fine on Android Phone but on Win Desktop it is returning Blank image and
bool iscom return true in case of Android and on Win Desktop it always return false.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions