Returns an image object containing the specified portion of the drawing.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
The portion of the drawing that you want to capture. Specify a rectangle in the canvas' coordinate system.
The scale factor at which to create the image. Specifying scale factors greater than
1creates an image with more detail. For example, you might specify a scale factor of
3when displaying the image on a Retina display.
A new image object containing the rendered content.
This method creates a new image and renders content from the canvas into that image at the specified scale factor.