androidx.compose.remote.creation.compose.capture

Classes

CapturedDocument

Represents the result of a remote Composable capture operation.

RemoteDensity

Represents the screen density and font scale factor used for unit conversions in a remote composition context.

RemoteImageVector

A base class for defining vector graphics that can be drawn in a remote compose.

RemoteImageVector.Builder

Builder used to construct a Vector graphic tree.

Top-level functions summary

suspend CapturedDocument
captureSingleRemoteDocument(
    context: Context,
    creationDisplayInfo: CreationDisplayInfo,
    profile: Profile,
    content: @Composable @RemoteComposable () -> Unit
)

Capture a RemoteCompose document by rendering the specified content Composable in a virtual display and returning the resulting bytes.

Extension functions summary

RemoteImageVector.Builder
RemoteImageVector.Builder.path(
    name: String,
    fill: Brush?,
    fillAlpha: RemoteFloat,
    stroke: Brush?,
    strokeAlpha: RemoteFloat,
    strokeLineWidth: RemoteFloat,
    strokeLineCap: StrokeCap,
    strokeLineJoin: StrokeJoin,
    strokeLineMiter: RemoteFloat,
    pathFillType: PathFillType,
    pathBuilder: RemotePathBuilder.() -> Unit
)

DSL extension for adding a RemoteVectorPath to this.

Top-level functions

captureSingleRemoteDocument

suspend fun captureSingleRemoteDocument(
    context: Context,
    creationDisplayInfo: CreationDisplayInfo = createCreationDisplayInfo(context),
    profile: Profile = RcPlatformProfiles.ANDROIDX,
    content: @Composable @RemoteComposable () -> Unit
): CapturedDocument

Capture a RemoteCompose document by rendering the specified content Composable in a virtual display and returning the resulting bytes.

This can be used for testing, or for generating documents on the fly to be sent to a remote client.

This API is experimental and is likely to change in the future before becoming API stable.

Parameters
context: Context

the Android Context to use for the capture.

creationDisplayInfo: CreationDisplayInfo = createCreationDisplayInfo(context)

details about the virtual display to create.

profile: Profile = RcPlatformProfiles.ANDROIDX

the Profile to use for the capture, determining which operations are supported.

content: @Composable @RemoteComposable () -> Unit

the Composable content to render and capture.

Returns
CapturedDocument

a ByteArray containing the RemoteCompose document.

Extension functions

RemoteImageVector.Builder.path

fun RemoteImageVector.Builder.path(
    name: String = DefaultPathName,
    fill: Brush? = null,
    fillAlpha: RemoteFloat = 1.0f.rf,
    stroke: Brush? = null,
    strokeAlpha: RemoteFloat = 1.0f.rf,
    strokeLineWidth: RemoteFloat = DefaultStrokeLineWidth,
    strokeLineCap: StrokeCap = DefaultStrokeLineCap,
    strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin,
    strokeLineMiter: RemoteFloat = DefaultStrokeLineMiter,
    pathFillType: PathFillType = DefaultFillType,
    pathBuilder: RemotePathBuilder.() -> Unit
): RemoteImageVector.Builder

DSL extension for adding a RemoteVectorPath to this.

Parameters
name: String = DefaultPathName

the name for this path

fill: Brush? = null

specifies the Brush used to fill the path

fillAlpha: RemoteFloat = 1.0f.rf

the alpha to fill the path

stroke: Brush? = null

specifies the Brush used to fill the stroke

strokeAlpha: RemoteFloat = 1.0f.rf

the alpha to stroke the path

strokeLineWidth: RemoteFloat = DefaultStrokeLineWidth

the width of the line to stroke the path

strokeLineCap: StrokeCap = DefaultStrokeLineCap

specifies the linecap for a stroked path

strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin

specifies the linejoin for a stroked path

strokeLineMiter: RemoteFloat = DefaultStrokeLineMiter

specifies the miter limit for a stroked path

pathFillType: PathFillType = DefaultFillType

specifies the winding rule that decides how the interior of a Path is calculated.

pathBuilder: RemotePathBuilder.() -> Unit

RemotePathBuilder lambda for adding RemotePathNodes to this path.