Skip to content

API Reference / @gtkx/testing / screenshot

Variable: screenshot

const screenshot: (widget, options?) => Promise<ScreenshotResult>

Defined in: screenshot.d.ts:10

Captures a PNG snapshot of a widget, retrying until it has a paintable size.

Parameters

widget

Gtk.Widget

The widget to render to an image.

options?

ScreenshotOptions

Optional scale, timeout, and retry interval.

Returns

Promise<ScreenshotResult>

The base64-encoded PNG data along with its mime type and dimensions.

Released under the MPL-2.0 License.