ScreenshotOptions Class
Options of a screenshot (see ImagingScreenshotExtensions).
public sealed class ScreenshotOptionsConstructors
| Name | Description |
|---|---|
| ScreenshotOptions() |
ScreenshotOptions()
public ScreenshotOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| Clip | Gets the area of the screenshot of a viewport, in CSS pixels: relative to the viewport, or to the origin of the document with ScreenshotOptions.FullPage. The area is clipped to the viewport (or to the document); it must not be empty once clipped. The default is null: the whole viewport (or document). It is ignored by the screenshots of the elements. |
| DevicePixelRatio | Gets the number of pixels of the screenshot per CSS pixel. The default is null: the ViewportOptions.DevicePixelRatio of the browsing context (a screenshot of a 800x600 viewport at a device pixel ratio of 2 is 1600x1200 pixels). Changing it does not change the layout (the media queries still see the device pixel ratio of the viewport): the painting is scaled. |
| FullPage | Gets whether the screenshot of a viewport shows the whole document instead of the viewport: the scrolling area of the viewport from the origin of the document (its scrollWidth and scrollHeight, at least the size of the viewport). The layout does not change: the viewport units and the media queries still see the size of the viewport, the fixed positioned elements are painted once, where they are in the document at the current scroll position (at the top of the document when it is not scrolled), and the scrollbars of the viewport are not painted. The default is false. It is ignored by the screenshots of the elements. |
| OmitBackground | Gets whether the background of the canvas of a top-level document is omitted: the document is painted over a transparent canvas instead of the color of the canvas (white, or a dark color for a document with a dark color scheme), so the parts of the page that the document does not paint are transparent. The backgrounds of the document (of its root element and of its body) are still painted. For the printed pages, the pages are painted over a transparent sheet instead of white paper. The default is false. It is ignored by the JPEG screenshots, which have no alpha channel. |
| Quality | Gets the quality of the JPEG screenshots, from 0 to 100. The default is null: 80, the quality of the JPEG screenshots of Chromium. It is ignored by the PNG screenshots. |
Gets the area of the screenshot of a viewport, in CSS pixels: relative to the viewport, or to the origin of the document with ScreenshotOptions.FullPage. The area is clipped to the viewport (or to the document); it must not be empty once clipped. The default is null: the whole viewport (or document). It is ignored by the screenshots of the elements.
public ScreenshotClip? Clip { get; init; }DevicePixelRatio
ScreenshotOptions.csGets the number of pixels of the screenshot per CSS pixel. The default is null: the ViewportOptions.DevicePixelRatio of the browsing context (a screenshot of a 800x600 viewport at a device pixel ratio of 2 is 1600x1200 pixels). Changing it does not change the layout (the media queries still see the device pixel ratio of the viewport): the painting is scaled.
public double? DevicePixelRatio { get; init; }Property value
FullPage
ScreenshotOptions.csGets whether the screenshot of a viewport shows the whole document instead of the viewport: the scrolling area of the viewport from the origin of the document (its scrollWidth and scrollHeight, at least the size of the viewport). The layout does not change: the viewport units and the media queries still see the size of the viewport, the fixed positioned elements are painted once, where they are in the document at the current scroll position (at the top of the document when it is not scrolled), and the scrollbars of the viewport are not painted. The default is false. It is ignored by the screenshots of the elements.
public bool FullPage { get; init; }OmitBackground
ScreenshotOptions.csGets whether the background of the canvas of a top-level document is omitted: the document is painted over a transparent canvas instead of the color of the canvas (white, or a dark color for a document with a dark color scheme), so the parts of the page that the document does not paint are transparent. The backgrounds of the document (of its root element and of its body) are still painted. For the printed pages, the pages are painted over a transparent sheet instead of white paper. The default is false. It is ignored by the JPEG screenshots, which have no alpha channel.
public bool OmitBackground { get; init; }