androidx.compose.ui.graphics.drawscope
Interfaces
ContentDrawScope |
Receiver scope for drawing content into a layout, where the content can be drawn between other canvas operations. |
DrawContext |
Object that provides the dependencies to support a DrawScope drawing environment. |
DrawScope |
Creates a scoped drawing environment with the provided Canvas. |
DrawTransform |
Defines transformations that can be applied to a drawing environment |
Classes
CanvasDrawScope |
Implementation of DrawScope that issues drawing commands into the specified canvas and bounds via CanvasDrawScope.draw |
DrawStyle |
Represents how the shapes should be drawn within a DrawScope |
Stroke |
DrawStyle that provides information for drawing content with a stroke |
Annotations
DrawScopeMarker |
DSL marker used to distinguish between drawing operations and canvas transform operations |
Extension functions summary
For DrawScope | |
Unit |
Reduces the clip region to the intersection of the current clip and the given path. |
Unit |
DrawScope.clipRect(left: Float = 0.0f, top: Float = 0.0f, right: Float = size.width, bottom: Float = size.height, clipOp: ClipOp = ClipOp.Intersect, block: DrawScope.() -> Unit) Reduces the clip region to the intersection of the current clip and the given rectangle indicated by the given left, top, right and bottom bounds. |
Unit |
DrawScope.drawIntoCanvas(block: (Canvas) -> Unit) Provides access to draw directly with the underlying Canvas. |
Unit |
Simultaneously translate the DrawScope coordinate space by left and top as well as modify the dimensions of the current painting area. |
Unit |
Convenience method modifies the DrawScope bounds to inset both left, top, right and bottom bounds by inset. |
Unit |
Convenience method modifies the DrawScope bounds to inset both left and right bounds by horizontal as well as the top and bottom by vertical. |
Unit |
Add a rotation (in degrees clockwise) to the current transform at the given pivot point. |
Unit |
Add a rotation (in radians clockwise) to the current transform at the given pivot point. |
Unit |
Add an axis-aligned scale to the current transform, scaling by the first argument in the horizontal direction and the second in the vertical direction at the given pivot coordinate. |
Unit |
Add an axis-aligned scale to the current transform, scaling both the horizontal direction and the vertical direction at the given pivot coordinate. |
Unit |
Translate the coordinate space by the given delta in pixels in both the x and y coordinates respectively |
Unit |
DrawScope.withTransform(transformBlock: DrawTransform.() -> Unit, drawBlock: DrawScope.() -> Unit) Perform 1 or more transformations and execute drawing commands with the specified transformations applied. |
For DrawTransform | |
Unit |
DrawTransform.inset(horizontal: Float = 0.0f, vertical: Float = 0.0f) Convenience method modifies the DrawTransform bounds to inset both left and right bounds by horizontal as well as the top and bottom by vertical. |
Unit |
DrawTransform.inset(inset: Float) Convenience method modifies the DrawScope bounds to inset both left, top, right and bottom bounds by inset. |
Unit |
DrawTransform.rotateRad(radians: Float, pivot: Offset = center) Add a rotation (in radians clockwise) to the current transform at the given pivot point. |
Unit |
DrawTransform.scale(scale: Float, pivot: Offset = center) Add an axis-aligned scale to the current transform, scaling uniformly in both directions by the provided scale factor at the pivot coordinate. |