PictureKt

Added in 1.1.0

public final class PictureKt


Summary

Public methods

static final @NonNull Picture
record(
    @NonNull Picture receiver,
    int width,
    int height,
    @ExtensionFunctionType @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

record

public static final @NonNull Picture record(
    @NonNull Picture receiver,
    int width,
    int height,
    @ExtensionFunctionType @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(…)
}