# PictureKt

Added in 1.1.0

*** ** * ** ***


```
public final class PictureKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Picture.html` | `https://developer.android.com/reference/androidx/core/graphics/PictureKt#(android.graphics.Picture).record(kotlin.Int,kotlin.Int,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Picture.html receiver, int width, int height, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Canvas.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block )` Creates a new `https://developer.android.com/reference/android/graphics/Canvas.html` to record commands in this `https://developer.android.com/reference/android/graphics/Picture.html`, executes the specified `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.Picture).record(kotlin.Int,kotlin.Int,kotlin.Function1)` on the newly created canvas and returns this `https://developer.android.com/reference/android/graphics/Picture.html`. |

## Public methods

### record

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Picture.kt+function:record) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Picture record(
    @NonNull Picture receiver,
    int width,
    int height,
    @NonNull Function1<@NonNull Canvas, Unit> block
)
```

Creates a new `https://developer.android.com/reference/android/graphics/Canvas.html` to record commands in this `https://developer.android.com/reference/android/graphics/Picture.html`, executes the specified `https://developer.android.com/reference/androidx/core/graphics/package-summary#(android.graphics.Picture).record(kotlin.Int,kotlin.Int,kotlin.Function1)` on the newly created canvas and returns this `https://developer.android.com/reference/android/graphics/Picture.html`. Example:

```
return myPicture.record(1280, 720) {
   drawLine(…)
   translate(…)
   drawRect(…)
}
```