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.
Companion Object
Methods
invoke
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. |
createNamedRemoteBitmap
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. |
createOffscreenRemoteBitmap
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. |