readImage Method
Deprecated in 3.x. Use readImageBuffer.
Read the current image from this viewport from the rendering system. If a "null" rectangle is supplied (See: ViewRect.isNull), the entire view is captured.
readImage(rect: ViewRect..., targetSize: Point2d..., flipVertically: booleanfalse): undefined | ImageBuffer
@returns The contents of the viewport within the specified rectangle as a bitmap image, or undefined if the image could not be read.
@note By default the image is returned with the coordinate (0,0) referring to the bottom-most pixel. Pass true
for flipVertically
to flip it along the x-axis.
Parameter | Type | Description |
---|---|---|
rect | ViewRect | The area of the view to read. The origin of a viewRect must specify the upper left corner. |
targetSize | Point2d | The size of the image to be returned. The size can be larger or smaller than the original view. |
flipVertically | boolean | If true, the image is flipped along the x-axis. |
Returns - undefined | ImageBuffer
The contents of the viewport within the specified rectangle as a bitmap image, or undefined if the image could not be read.
Defined in
- core/frontend/src/Viewport.ts Line 2689
Last Updated: 17 December, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.