Composable Function
Common
Deprecated Replace rememberVectorPainter graphicsLayer that consumes the auto mirror flag
@Composable
@ComposableOpenTarget(-1)
fun rememberVectorPainter(
defaultWidth: Dp,
defaultHeight: Dp,
viewportWidth: Float = Float.NaN,
viewportHeight: Float = Float.NaN,
name: String = RootGroupName,
tintColor: Color = Color.Unspecified,
tintBlendMode: BlendMode = BlendMode.SrcIn,
content: @Composable @VectorComposable (viewportWidth: Float, viewportHeight: Float) -> Unit,
): VectorPainter
Create a VectorPainter with the Vector defined by the provided sub-composition
Parameters
defaultWidth |
Intrinsic width of the Vector in Dp |
defaultHeight |
Intrinsic height of the Vector in Dp |
viewportWidth |
Width of the viewport space. The viewport is the virtual canvas where paths are drawn on. This parameter is optional. Not providing it will use the defaultWidth converted to pixels |
viewportHeight |
Height of the viewport space. The viewport is the virtual canvas where paths are drawn on. This parameter is optional. Not providing it will use the defaultHeight converted to pixels |
name |
optional identifier used to identify the root of this vector graphic |
tintColor |
optional color used to tint the root group of this vector graphic |
tintBlendMode |
BlendMode used in combination with tintColor |
content |
Composable used to define the structure and contents of the vector graphic |
Common
@Composable
@ComposableOpenTarget(-1)
fun rememberVectorPainter(
defaultWidth: Dp,
defaultHeight: Dp,
viewportWidth: Float = Float.NaN,
viewportHeight: Float = Float.NaN,
name: String = RootGroupName,
tintColor: Color = Color.Unspecified,
tintBlendMode: BlendMode = BlendMode.SrcIn,
autoMirror: Boolean = false,
content: @Composable @VectorComposable (viewportWidth: Float, viewportHeight: Float) -> Unit,
): VectorPainter
Create a VectorPainter with the Vector defined by the provided sub-composition.
Inside content use the Group and Path composables to define the vector.
Parameters
defaultWidth |
Intrinsic width of the Vector in Dp |
defaultHeight |
Intrinsic height of the Vector in Dp |
viewportWidth |
Width of the viewport space. The viewport is the virtual canvas where paths are drawn on. This parameter is optional. Not providing it will use the defaultWidth converted to pixels |
viewportHeight |
Height of the viewport space. The viewport is the virtual canvas where paths are drawn on. This parameter is optional. Not providing it will use the defaultHeight converted to pixels |
name |
optional identifier used to identify the root of this vector graphic |
tintColor |
optional color used to tint the root group of this vector graphic |
tintBlendMode |
BlendMode used in combination with tintColor |
autoMirror |
Determines if the contents of the Vector should be mirrored for right to left layouts. |
content |
Composable used to define the structure and contents of the vector graphic |
Common
@Composable
fun rememberVectorPainter(image: ImageVector): VectorPainter
Create a VectorPainter with the given ImageVector. This will create a sub-composition of the vector hierarchy given the tree structure in ImageVector
Parameters
image |
ImageVector used to create a vector graphic sub-composition |