rememberVectorPainter

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

defaultWidthIntrinsic width of the Vector in Dp
defaultHeightIntrinsic height of the Vector in Dp
viewportWidthWidth 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
viewportHeightHeight 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
nameoptional identifier used to identify the root of this vector graphic
tintColoroptional color used to tint the root group of this vector graphic
tintBlendModeBlendMode used in combination with tintColor
contentComposable 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

defaultWidthIntrinsic width of the Vector in Dp
defaultHeightIntrinsic height of the Vector in Dp
viewportWidthWidth 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
viewportHeightHeight 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
nameoptional identifier used to identify the root of this vector graphic
tintColoroptional color used to tint the root group of this vector graphic
tintBlendModeBlendMode used in combination with tintColor
autoMirrorDetermines if the contents of the Vector should be mirrored for right to left layouts.
contentComposable 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

imageImageVector used to create a vector graphic sub-composition