← Back to Compose UI
Path
Overview
Code Examples
Defines a path inside a VectorPainter. This is not a regular UI composable, it can only be called inside composables called from the content parameter to rememberVectorPainter.
@param pathData List of PathNodes that define the path. @param pathFillType The PathFillType that specifies how to fill the path. @param name Optional name of the path used when describing the vector as a string. @param fill The Brush used to fill the path. @param fillAlpha The alpha value to use for fill. @param stroke The Brush used to stroke the path. @param strokeAlpha The alpha value to use for stroke. @param strokeLineWidth The width of the stroke. See Stroke.width for details. @param strokeLineCap The StrokeCap of stroke. See Stroke.cap for details. @param strokeLineJoin The StrokeJoin of stroke. See Stroke.join for details. @param strokeLineMiter The stroke miter value. See Stroke.miter for details. @param trimPathStart The fraction of the path that specifies the start of the clipped region of the path. See PathMeasure.getSegment. @param trimPathEnd The fraction of the path that specifies the end of the clipped region of the path. See PathMeasure.getSegment. @param trimPathOffset The amount to offset both trimPathStart and trimPathEnd.
Overloads
Path
@Composable
@VectorComposable
fun Path(
pathData: List<PathNode>,
pathFillType: PathFillType = DefaultFillType,
name: String = DefaultPathName,
fill: Brush? = null,
fillAlpha: Float = 1.0f,
stroke: Brush? = null,
strokeAlpha: Float = 1.0f,
strokeLineWidth: Float = DefaultStrokeLineWidth,
strokeLineCap: StrokeCap = DefaultStrokeLineCap,
strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin,
strokeLineMiter: Float = DefaultStrokeLineMiter,
trimPathStart: Float = DefaultTrimPathStart,
trimPathEnd: Float = DefaultTrimPathEnd,
trimPathOffset: Float = DefaultTrimPathOffset
)
Parameters
Name | Description |
---|---|
pathData | List of PathNodes that define the path. |
pathFillType | The PathFillType that specifies how to fill the path. |
name | Optional name of the path used when describing the vector as a string. |
fill | The Brush used to fill the path. |
fillAlpha | The alpha value to use for fill. |
stroke | The Brush used to stroke the path. |
strokeAlpha | The alpha value to use for stroke. |
strokeLineWidth | The width of the stroke. See Stroke.width for details. |
strokeLineCap | The StrokeCap of stroke. See Stroke.cap for details. |
strokeLineJoin | The StrokeJoin of stroke. See Stroke.join for details. |
strokeLineMiter | The stroke miter value. See Stroke.miter for details. |
trimPathStart | The fraction of the path that specifies the start of the clipped region of the path. See PathMeasure.getSegment. |
trimPathEnd | The fraction of the path that specifies the end of the clipped region of the path. See PathMeasure.getSegment. |
trimPathOffset | The amount to offset both trimPathStart and trimPathEnd |