# StrokeDrawScope

Artifact: [androidx.ink:ink-rendering](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/rendering/android/canvas/StrokeDrawScope.android.kt+class:androidx.ink.rendering.android.canvas.StrokeDrawScope) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

*** ** * ** ***


```
public final class StrokeDrawScope
```

<br />

*** ** * ** ***

A utility to simplify usage of `https://developer.android.com/reference/androidx/ink/rendering/android/canvas/CanvasStrokeRenderer` by automatically calculating the `strokeToCanvasTransform` parameter of `https://developer.android.com/reference/androidx/ink/rendering/android/canvas/CanvasStrokeRenderer#draw(android.graphics.Canvas,androidx.ink.strokes.Stroke,androidx.ink.geometry.AffineTransform)`. Obtain an instance of this class using `https://developer.android.com/reference/androidx/ink/rendering/android/view/ViewStrokeRenderer`, if using `https://developer.android.com/reference/android/view/View.html`. Use this scope by calling its `https://developer.android.com/reference/androidx/ink/rendering/android/canvas/StrokeDrawScope#drawStroke(androidx.ink.strokes.Stroke)` function.

## Summary

| ### Public methods |
|---|---|
| `final void` | `https://developer.android.com/reference/androidx/ink/rendering/android/canvas/StrokeDrawScope#drawStroke(androidx.ink.strokes.Stroke)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/ink/strokes/Stroke stroke)` Draw the given `https://developer.android.com/reference/androidx/ink/strokes/Stroke` to the `https://developer.android.com/reference/android/graphics/Canvas.html` represented by this scope. |

## Public methods

### drawStroke

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/ink#1.0.0)

```
public final void drawStroke(@NonNull Stroke stroke)
```

Draw the given `https://developer.android.com/reference/androidx/ink/strokes/Stroke` to the `https://developer.android.com/reference/android/graphics/Canvas.html` represented by this scope.