readImageBuffer Method

Capture the image currently rendered in this viewport, or a subset thereof.

readImageBuffer(args?: ReadImageBufferArgs): undefined | ImageBuffer

Parameter Type Description
args ReadImageBufferArgs Describes the region to capture and optional resizing. By default the entire image is captured with no resizing.

Returns - undefined | ImageBuffer

The image, or undefined if the specified capture rect is not fully contained in [[viewRect], a 2d context could not be obtained, or the resultant image consists entirely of 100% transparent background pixels.

Defined in

Last Updated: 20 June, 2023