androidx.compose.ui.graphics.vector

Interfaces

VectorConfig

Holds a set of values that overwrite the original property values of an ImageVector.

Cmn

Classes

ImageVector

Vector graphics object that is generated as a result of ImageVector.Builder It can be composed and rendered by passing it as an argument to rememberVectorPainter

Cmn
ImageVector.Builder

Builder used to construct a Vector graphic tree.

Cmn
PathBuilder

PathBuilder provides a fluent API to creates a list of PathNode, used to describe a path.

Cmn
PathNode

Represents a single command in a vector graphics path.

Cmn
PathNode.ArcTo

Draws an elliptical arc from the current point to a new point using absolute coordinates.

Cmn
PathNode.CurveTo

Draws a cubic Bézier curve from the current point to a new point using absolute coordinates.

Cmn
PathNode.HorizontalTo

Draws a horizontal line from the current point to the specified absolute x-coordinate.

Cmn
PathNode.LineTo

Draws a line from the current point to the specified absolute (x,y) coordinate.

Cmn
PathNode.MoveTo

Starts a new subpath at the given absolute (x,y) coordinate.

Cmn
PathNode.QuadTo

Draws a quadratic Bézier curve from the current point to a new point using absolute coordinates.

Cmn
PathNode.ReflectiveCurveTo

Draws a smooth cubic Bézier curve using absolute coordinates.

Cmn
PathNode.ReflectiveQuadTo

Draws a smooth quadratic Bézier curve using absolute coordinates.

Cmn
PathNode.RelativeArcTo

Draws an elliptical arc from the current point to a new point using relative coordinates.

Cmn
PathNode.RelativeCurveTo

Draws a cubic Bézier curve from the current point to a new point using relative coordinates.

Cmn
PathNode.RelativeHorizontalTo

Draws a horizontal line from the current point, offset by a relative distance dx.

Cmn
PathNode.RelativeLineTo

Draws a line from the current point to a new point, defined by a relative offset.

Cmn
PathNode.RelativeMoveTo

Starts a new subpath at a point defined by a relative offset from the current point.

Cmn
PathNode.RelativeQuadTo

Draws a quadratic Bézier curve from the current point to a new point using relative coordinates.

Cmn
PathNode.RelativeReflectiveCurveTo

Draws a smooth cubic Bézier curve using relative coordinates.

Cmn
PathNode.RelativeReflectiveQuadTo

Draws a smooth quadratic Bézier curve using relative coordinates.

Cmn
PathNode.RelativeVerticalTo

Draws a vertical line from the current point, offset by a relative distance dy.

Cmn
PathNode.VerticalTo

Draws a vertical line from the current point to the specified absolute y-coordinate.

Cmn
PathParser
Cmn
VNode
Cmn
VectorApplier
Cmn
VectorGroup

Defines a group of paths or subgroups, plus transformation information.

Cmn
VectorNode
Cmn
VectorPainter

Painter implementation that abstracts the drawing of a Vector graphic.

Cmn
VectorPath

Leaf node of a Vector graphics tree.

Cmn
VectorProperty

Represents one of the properties for PathComponent or GroupComponent that can be overwritten when it is composed and drawn with RenderVectorGroup.

Cmn

Objects

Annotations

VectorComposable

An annotation that can be used to mark an composable function as being expected to be use in a composable function that is also marked or inferred to be marked as a VectorComposable.

Cmn

Composables

Group

Defines a group of Paths and other Groups inside a VectorPainter.

Cmn
Path

Defines a path inside a VectorPainter.

Cmn
RenderVectorGroup

Recursively creates the vector graphic composition by traversing the tree structure.

Cmn
rememberVectorPainter

Create a VectorPainter with the given ImageVector.

Cmn

Constants summary

const String
Cmn
const String
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const Float
Cmn
const String

Default identifier for the root group if a Vector graphic

Cmn

Top-level functions summary

inline List<PathNode>
PathData(block: PathBuilder.() -> Unit)
Cmn
List<PathNode>
addPathNodes(pathStr: String?)
Cmn

Extension functions summary

inline ImageVector.Builder
ImageVector.Builder.group(
    name: String,
    rotate: Float,
    pivotX: Float,
    pivotY: Float,
    scaleX: Float,
    scaleY: Float,
    translationX: Float,
    translationY: Float,
    clipPathData: List<PathNode>,
    block: ImageVector.Builder.() -> Unit
)

DSL extension for adding a VectorGroup to this.

Cmn
inline ImageVector.Builder
ImageVector.Builder.path(
    name: String,
    fill: Brush?,
    fillAlpha: Float,
    stroke: Brush?,
    strokeAlpha: Float,
    strokeLineWidth: Float,
    strokeLineCap: StrokeCap,
    strokeLineJoin: StrokeJoin,
    strokeLineMiter: Float,
    pathFillType: PathFillType,
    pathBuilder: PathBuilder.() -> Unit
)

DSL extension for adding a VectorPath to this.

Cmn
Path

Converts this list of PathNode into a Path by adding the appropriate commands to the target path.

Cmn

Top-level properties summary

Constants

DefaultGroupName

const val DefaultGroupNameString

DefaultPathName

const val DefaultPathNameString

DefaultPivotX

const val DefaultPivotX = 0.0f: Float

DefaultPivotY

const val DefaultPivotY = 0.0f: Float

DefaultRotation

const val DefaultRotation = 0.0f: Float

DefaultScaleX

const val DefaultScaleX = 1.0f: Float

DefaultScaleY

const val DefaultScaleY = 1.0f: Float

DefaultStrokeLineMiter

const val DefaultStrokeLineMiter = 4.0f: Float

DefaultStrokeLineWidth

const val DefaultStrokeLineWidth = 0.0f: Float

DefaultTranslationX

const val DefaultTranslationX = 0.0f: Float

DefaultTranslationY

const val DefaultTranslationY = 0.0f: Float

DefaultTrimPathEnd

const val DefaultTrimPathEnd = 1.0f: Float

DefaultTrimPathOffset

const val DefaultTrimPathOffset = 0.0f: Float

DefaultTrimPathStart

const val DefaultTrimPathStart = 0.0f: Float

RootGroupName

const val RootGroupNameString

Default identifier for the root group if a Vector graphic

Top-level functions

PathData

inline fun PathData(block: PathBuilder.() -> Unit): List<PathNode>

addPathNodes

fun addPathNodes(pathStr: String?): List<PathNode>

Extension functions

ImageVector.Builder.group

inline fun ImageVector.Builder.group(
    name: String = DefaultGroupName,
    rotate: Float = DefaultRotation,
    pivotX: Float = DefaultPivotX,
    pivotY: Float = DefaultPivotY,
    scaleX: Float = DefaultScaleX,
    scaleY: Float = DefaultScaleY,
    translationX: Float = DefaultTranslationX,
    translationY: Float = DefaultTranslationY,
    clipPathData: List<PathNode> = EmptyPath,
    block: ImageVector.Builder.() -> Unit
): ImageVector.Builder

DSL extension for adding a VectorGroup to this.

See ImageVector.Builder.addGroup for the corresponding builder function.

Parameters
name: String = DefaultGroupName

the name of the group

rotate: Float = DefaultRotation

the rotation of the group in degrees

pivotX: Float = DefaultPivotX

the x coordinate of the pivot point to rotate or scale the group

pivotY: Float = DefaultPivotY

the y coordinate of the pivot point to rotate or scale the group

scaleX: Float = DefaultScaleX

the scale factor in the X-axis to apply to the group

scaleY: Float = DefaultScaleY

the scale factor in the Y-axis to apply to the group

translationX: Float = DefaultTranslationX

the translation in virtual pixels to apply along the x-axis

translationY: Float = DefaultTranslationY

the translation in virtual pixels to apply along the y-axis

clipPathData: List<PathNode> = EmptyPath

the path information used to clip the content within the group

block: ImageVector.Builder.() -> Unit

builder lambda to add children to this group

ImageVector.Builder.path

inline fun ImageVector.Builder.path(
    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,
    pathFillType: PathFillType = DefaultFillType,
    pathBuilder: PathBuilder.() -> Unit
): ImageVector.Builder

DSL extension for adding a VectorPath to this.

See ImageVector.Builder.addPath for the corresponding builder function.

Parameters
name: String = DefaultPathName

the name for this path

fill: Brush? = null

specifies the Brush used to fill the path

fillAlpha: Float = 1.0f

the alpha to fill the path

stroke: Brush? = null

specifies the Brush used to fill the stroke

strokeAlpha: Float = 1.0f

the alpha to stroke the path

strokeLineWidth: Float = DefaultStrokeLineWidth

the width of the line to stroke the path

strokeLineCap: StrokeCap = DefaultStrokeLineCap

specifies the linecap for a stroked path

strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin

specifies the linejoin for a stroked path

strokeLineMiter: Float = DefaultStrokeLineMiter

specifies the miter limit for a stroked path

pathFillType: PathFillType = DefaultFillType

specifies the winding rule that decides how the interior of a Path is calculated.

pathBuilder: PathBuilder.() -> Unit

PathBuilder lambda for adding PathNodes to this path.

List.toPath

fun List<PathNode>.toPath(target: Path = Path()): Path

Converts this list of PathNode into a Path by adding the appropriate commands to the target path. If target is not specified, a new Path instance is created. This method returns target or the newly created Path.

Top-level properties

DefaultFillType

val DefaultFillTypePathFillType

DefaultStrokeLineCap

val DefaultStrokeLineCapStrokeCap

DefaultStrokeLineJoin

val DefaultStrokeLineJoinStrokeJoin

DefaultTintBlendMode

val DefaultTintBlendModeBlendMode

DefaultTintColor

val DefaultTintColorColor

EmptyPath

val EmptyPathList<PathNode>