PictureKt

public final class PictureKt


Summary

Public methods

static final @NonNull Picture
PictureKt.record(
    @NonNull Picture receiver,
    int width,
    int height,
    @NonNull Function1<@NonNull CanvasUnit> block
)

Creates a new Canvas to record commands in this Picture, executes the specified block on the newly created canvas and returns this Picture.

Public methods

PictureKt.record

@NonNull
public static final Picture PictureKt.record(
    @NonNull Picture receiver,
    int width,
    int height,
    @NonNull Function1<@NonNull CanvasUnit> block
)

Creates a new Canvas to record commands in this Picture, executes the specified block on the newly created canvas and returns this Picture. Example:

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