ChromiumWebBrowserCaptureScreenshotAsync Method |
Version 130.1.90
Capture page screenshot.
Namespace: CefSharp.WinFormsAssembly: CefSharp.WinForms (in CefSharp.WinForms.dll) Version: 129.0.110.0 (129.0.110.0)
Syntax public Task<byte[]> CaptureScreenshotAsync(
CaptureScreenshotFormat format = CaptureScreenshotFormat.Png,
int? quality = null,
Viewport viewPort = null,
bool fromSurface = true,
bool captureBeyondViewport = false
)
public:
Task<array<unsigned char>^>^ CaptureScreenshotAsync(
CaptureScreenshotFormat format = CaptureScreenshotFormat::Png,
Nullable<int> quality = nullptr,
Viewport^ viewPort = nullptr,
bool fromSurface = true,
bool captureBeyondViewport = false
)
Parameters
- format CaptureScreenshotFormat (Optional)
- Image compression format (defaults to png).
- quality NullableInt32 (Optional)
- Compression quality from range [0..100] (jpeg only).
- viewPort Viewport (Optional)
- Capture the screenshot of a given region only.
- fromSurface Boolean (Optional)
- Capture the screenshot from the surface, rather than the view. Defaults to true.
- captureBeyondViewport Boolean (Optional)
- Capture the screenshot beyond the viewport. Defaults to false.
Return Value
TaskByteA task that can be awaited to obtain the screenshot as a byte[].
See Also