Returns an image object containing the specified portion of the drawing.
SDKs
- macOS 10.15+
- Xcode 11.0+
Framework
- Pencil
Kit
Declaration
Parameters
rect
The portion of the drawing that you want to capture. Specify a rectangle in the canvas' coordinate system.
scale
The scale factor at which to create the image. Specifying scale factors greater than
1
creates an image with more detail. For example, you might specify a scale factor of.0 2
or.0 3
when displaying the image on a Retina display..0
Return Value
A new image object containing the rendered content.
Discussion
This method creates a new image and renders content from the canvas into that image at the specified scale factor.