public abstract class RemoteImageBitmap
internal constructor(
public override val constantValueOrNull: ImageBitmap?,
cacheKey: RemoteStateCacheKey,
) : BaseRemoteState<ImageBitmap>(cacheKey)
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.
Properties
width
public val width: RemoteFloat
The width of the bitmap as represented in the remote document.
height
public val height: RemoteFloat
The height of the bitmap as represented in the remote document.
Companion Object
Methods
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public operator fun invoke(value: ImageBitmap): MutableRemoteImageBitmap
Creates a RemoteImageBitmap instance from a ImageBitmap value. This factory method can be used with or without an explicit RemoteComposeCreationState.
Parameters
| value | The ImageBitmap value. |
Returns
| A RemoteImageBitmap representing the provided bitmap. |
@JvmStatic
public 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 | 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 RemoteImageBitmap representing the named bitmap. |
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public fun createOffscreenRemoteBitmap(width: Int, height: Int): RemoteImageBitmap
Creates a RemoteImageBitmap with the specified width and height.
Parameters
| width | The width of the RemoteImageBitmap to create |
| height | The height of the RemoteImageBitmap to create |
Returns
| A RemoteImageBitmap with the specified width and height. |