abstract class RemoteImageBitmap : BaseRemoteState

Known direct subclasses
MutableRemoteImageBitmap

A mutable implementation of RemoteImageBitmap that holds its value in a MutableState.


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

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

Summary

Public companion functions

RemoteImageBitmap
createNamedRemoteImageBitmap(
    name: String,
    defaultValue: ImageBitmap,
    domain: RemoteState.Domain
)

Creates a named RemoteImageBitmap with an initial value.

operator RemoteImageBitmap
invoke(url: String)

Creates a RemoteImageBitmap from a URL.

operator RemoteImageBitmap

Creates a RemoteImageBitmap instance from a ImageBitmap value.

Public properties

open ImageBitmap?

The constant value or null if there isn't one.

RemoteFloat

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

RemoteFloat

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

Inherited properties

From androidx.compose.remote.creation.compose.state.RemoteState
open ImageBitmap

The constant value held by this state.

open Boolean

Whether or not this remote state evaluates to a constant value.

Public companion functions

createNamedRemoteImageBitmap

Added in 1.0.0-alpha16
fun createNamedRemoteImageBitmap(
    name: String,
    defaultValue: ImageBitmap,
    domain: RemoteState.Domain = RemoteState.Domain.User
): RemoteImageBitmap

Creates a named RemoteImageBitmap with an initial value.

Named remote bitmaps can be set via AndroidRemoteContext.setNamedBitmap.

Parameters
name: String

A unique name to identify this state within its domain.

defaultValue: ImageBitmap

The initial ImageBitmap value for the named remote bitmap.

domain: RemoteState.Domain = RemoteState.Domain.User

The domain for the named state. Defaults to RemoteState.Domain.User.

Returns
RemoteImageBitmap

A RemoteImageBitmap representing the named bitmap.

invoke

Added in 1.0.0-alpha16
operator fun invoke(url: String): RemoteImageBitmap

Creates a RemoteImageBitmap from a URL.

Parameters
url: String

The URL of the image.

Returns
RemoteImageBitmap

A RemoteImageBitmap representing the image from the URL.

invoke

Added in 1.0.0-alpha16
operator fun invoke(value: ImageBitmap): RemoteImageBitmap

Creates a RemoteImageBitmap instance from a ImageBitmap value.

Parameters
value: ImageBitmap

The ImageBitmap value.

Returns
RemoteImageBitmap

A RemoteImageBitmap representing the provided bitmap.

Public properties

constantValueOrNull

open val constantValueOrNullImageBitmap?

The constant value or null if there isn't one.

height

Added in 1.0.0-alpha16
val heightRemoteFloat

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

width

Added in 1.0.0-alpha16
val widthRemoteFloat

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