rememberVectorPainter

Functions summary

VectorPainter

Create a VectorPainter with the given ImageVector.

Cmn
VectorPainter
@Composable
@ComposableOpenTarget(index = -1)
rememberVectorPainter(
    defaultWidth: Dp,
    defaultHeight: Dp,
    viewportWidth: Float,
    viewportHeight: Float,
    name: String,
    tintColor: Color,
    tintBlendMode: BlendMode,
    content: @Composable @VectorComposable (viewportWidth: Float, viewportHeight: Float) -> Unit
)

This function is deprecated. Replace rememberVectorPainter graphicsLayer that consumes the auto mirror flag

Cmn
VectorPainter
@Composable
@ComposableOpenTarget(index = -1)
rememberVectorPainter(
    defaultWidth: Dp,
    defaultHeight: Dp,
    viewportWidth: Float,
    viewportHeight: Float,
    name: String,
    tintColor: Color,
    tintBlendMode: BlendMode,
    autoMirror: Boolean,
    content: @Composable @VectorComposable (viewportWidth: Float, viewportHeight: Float) -> Unit
)

Create a VectorPainter with the Vector defined by the provided sub-composition.

Cmn

Functions

rememberVectorPainter

@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

ImageVector used to create a vector graphic sub-composition

rememberVectorPainter

@Composable
@ComposableOpenTarget(index = -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: Dp

Intrinsic width of the Vector in Dp

defaultHeight: Dp

Intrinsic height of the Vector in Dp

viewportWidth: Float

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: Float

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: String = RootGroupName

optional identifier used to identify the root of this vector graphic

tintColor: Color = Color.Unspecified

optional color used to tint the root group of this vector graphic

tintBlendMode: BlendMode = BlendMode.SrcIn

BlendMode used in combination with tintColor

content: @Composable @VectorComposable (viewportWidth: Float, viewportHeight: Float) -> Unit

Composable used to define the structure and contents of the vector graphic

rememberVectorPainter

@Composable
@ComposableOpenTarget(index = -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: Dp

Intrinsic width of the Vector in Dp

defaultHeight: Dp

Intrinsic height of the Vector in Dp

viewportWidth: Float

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: Float

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: String = RootGroupName

optional identifier used to identify the root of this vector graphic

tintColor: Color = Color.Unspecified

optional color used to tint the root group of this vector graphic

tintBlendMode: BlendMode = BlendMode.SrcIn

BlendMode used in combination with tintColor

autoMirror: Boolean = false

Determines if the contents of the Vector should be mirrored for right to left layouts.

content: @Composable @VectorComposable (viewportWidth: Float, viewportHeight: Float) -> Unit

Composable used to define the structure and contents of the vector graphic