# VectorPainter

Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/vector/VectorPainter.kt+class:androidx.compose.ui.graphics.vector.VectorPainter) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/All
- Cmn

  ```
  class VectorPainter : Painter
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.compose.ui.graphics.painter.Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter) ||
|   | ↳ | [androidx.compose.ui.graphics.vector.VectorPainter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/VectorPainter) |

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` implementation that abstracts the drawing of a Vector graphic. This can be represented by either a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/ImageVector` or a programmatic composition of a vector

## Summary

| ### Protected functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/VectorPainter#applyAlpha(kotlin.Float)(alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/VectorPainter#applyColorFilter(androidx.compose.ui.graphics.ColorFilter)(colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?)` Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/VectorPainter#(androidx.compose.ui.graphics.drawscope.DrawScope).onDraw()()` Implementation of drawing logic for instances of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`. | Cmn |

| ### Public properties |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/vector/VectorPainter#intrinsicSize()` Return the intrinsic size of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`. | Cmn |

| ### Inherited functions |
|---|
| From [androidx.compose.ui.graphics.painter.Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter) |---|---|---| | `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter#applyLayoutDirection(androidx.compose.ui.unit.LayoutDirection)(layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection)` Apply the appropriate internal configuration to positioning content with the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | Cmn | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter#(androidx.compose.ui.graphics.drawscope.DrawScope).draw(androidx.compose.ui.geometry.Size,kotlin.Float,androidx.compose.ui.graphics.ColorFilter)(size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size, alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?)` | Cmn | |

## Protected functions

### applyAlpha

Cmn

```
protected open fun applyAlpha(alpha: Float): Boolean
```

Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied

### applyColorFilter

Cmn

```
protected open fun applyColorFilter(colorFilter: ColorFilter?): Boolean
```

Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied

### DrawScope.onDraw

Cmn Artifact: [androidx.compose.ui:ui](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/vector/VectorPainter.kt+function:onDraw) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
protected open fun DrawScope.onDraw(): Unit
```

Implementation of drawing logic for instances of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`. This is invoked internally within `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter#(androidx.compose.ui.graphics.drawscope.DrawScope).draw(androidx.compose.ui.geometry.Size,kotlin.Float,androidx.compose.ui.graphics.ColorFilter)` after the positioning and configuring the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`

## Public properties

### intrinsicSize

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
open val intrinsicSize: Size
```

Return the intrinsic size of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`. If the there is no intrinsic size (i.e. filling bounds with an arbitrary color) return `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#Unspecified()`. If there is no intrinsic size in a single dimension, return `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` with `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html` in the desired dimension. If a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` does not have an intrinsic size, it will always draw within the full bounds of the destination