NativeCanvas

typealias NativeCanvas = Canvas
androidx.ui.graphics.NativeCanvas

An interface for recording graphical operations.

A canvas has a current transformation matrix which is applied to all operations. Initially, the transformation matrix is the identity transform. It can be modified using the Canvas.translate, Canvas.scale, Canvas.rotate, Canvas.skew methods.

A canvas also has a current clip region which is applied to all operations. Initially, the clip region is infinite. It can be modified using the Canvas.clipRect, Canvas.clipRRect, and Canvas.clipPath methods.

The current transform and clip can be saved and restored using the stack managed by the Canvas.save, Canvas.saveLayer, and Canvas.restore methods.

Creates a canvas for recording graphical operations into the given picture recorder.

Graphical operations that affect pixels entirely outside the given cullRect might be discarded by the implementation. However, the implementation might draw outside these bounds if, for example, a command draws partially inside and outside the cullRect. To ensure that pixels outside a given region are discarded, consider using a Canvas.clipRect. The cullRect is optional; by default, all operations are kept.

To end the recording, call PictureRecorder.endRecording on the given recorder.

Summary