Class

RemoteBitmap

Abstract base class for all remote bitmap representations in Compose Remote, this class extends RemoteState.

Source set: Android
public abstract class RemoteBitmap
internal constructor(public override val constantValueOrNull: ImageBitmap?) :
    BaseRemoteState<ImageBitmap>()

Abstract base class for all remote bitmap representations in Compose Remote, this class extends [RemoteState].

RemoteBitmap represents an image value that can be a constant, a named variable, or an offscreen buffer.

Properties

width

Source set: Android
public val width: RemoteFloat

The width of the bitmap as represented in the remote document.

height

Source set: Android
public val height: RemoteFloat

The height of the bitmap as represented in the remote document.

Companion Object

Methods

Source set: Android
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public operator fun invoke(v: ImageBitmap): MutableRemoteBitmap

Creates a RemoteBitmap instance from a ImageBitmap value. This factory method can be used with or without an explicit RemoteComposeCreationState.

Parameters

v The ImageBitmap value.

Returns

A RemoteBitmap representing the provided bitmap.
Source set: Android
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@JvmStatic
public fun createNamedRemoteBitmap(
    name: String,
    defaultValue: ImageBitmap,
    domain: RemoteState.Domain = RemoteState.Domain.User,
): RemoteBitmap

Creates a named RemoteBitmap with an initial value.

Named remote bitmaps can be set via AndroidRemoteContext.setNamedBitmap.

Parameters

name A unique name to identify this state within its domain.
defaultValue The initial ImageBitmap value for the named remote bitmap.
domain The domain for the named state. Defaults to RemoteState.Domain.User.

Returns

A RemoteBitmap representing the named bitmap.
Source set: Android
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public fun createOffscreenRemoteBitmap(width: Int, height: Int): RemoteBitmap

Creates a RemoteBitmap with the specified width and height.

Parameters

width The width of the RemoteBitmap to create
height The height of the RemoteBitmap to create

Returns

A RemoteBitmap with the specified width and height.

Last updated: