ScreenshotOptions 接口
🌐 ScreenshotOptions interface
语法
🌐 Signature
export interface ScreenshotOptions
属性
🌐 Properties
属性 🌐 Property | 修饰符 🌐 Modifiers | 类型 🌐 Type | 描述 🌐 Description | 默认 🌐 Default |
|---|---|---|---|---|
| captureBeyondViewport |
| boolean | 捕获视口之外的屏幕截图。 🌐 Capture the screenshot beyond the viewport. |
|
| clip |
| 指定要剪辑的页面/元素的区域。 🌐 Specifies the region of the page/element to clip. | ||
| encoding |
| 'base64' | 'binary' | 图片的编码。 🌐 Encoding of the image. |
|
| fromSurface |
| boolean | 从表面而不是视图捕获屏幕截图。 🌐 Capture the screenshot from the surface, rather than the view. |
|
| fullPage |
| boolean | 当 🌐 When |
|
| omitBackground |
| boolean | 隐藏默认的白色背景并允许捕获透明的屏幕截图。 🌐 Hides default white background and allows capturing screenshots with transparency. |
|
| optimizeForSpeed |
| boolean |
| |
| path |
| string | 保存图片的文件路径。截图类型将从文件扩展名中推断。如果路径是相对路径,则相对于当前工作目录解析。如果未提供路径,图片将不会保存到磁盘。 🌐 The file path to save the image to. The screenshot type will be inferred from file extension. If path is a relative path, then it is resolved relative to current working directory. If no path is provided, the image won't be saved to the disk. | |
| quality |
| number | 图片质量,范围为0-100。不适用于 🌐 Quality of the image, between 0-100. Not applicable to | |
| type |
|
|