RemoteBasicImage

Functions summary

Unit
@Composable
@RemoteComposable
RemoteBasicImage(
    remoteBitmap: RemoteImageBitmap,
    contentDescription: RemoteString?,
    modifier: RemoteModifier,
    contentScale: ContentScale,
    alpha: RemoteFloat
)

A composable that lays out and draws a given RemoteImageBitmap.

Functions

@Composable
@RemoteComposable
fun RemoteBasicImage(
    remoteBitmap: RemoteImageBitmap,
    contentDescription: RemoteString?,
    modifier: RemoteModifier = RemoteModifier,
    contentScale: ContentScale = ContentScale.Fit,
    alpha: RemoteFloat = DefaultAlpha.rf
): Unit

A composable that lays out and draws a given RemoteImageBitmap. This is the remote equivalent of androidx.compose.foundation.Image.

import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rememberRemoteImageBitmap
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.remote.foundation.image.RemoteBasicImage

val remoteBitmap = rememberRemoteImageBitmap(url = "https://example.com/placeholder.png")
RemoteBasicImage(
    remoteBitmap = remoteBitmap,
    contentDescription = "Sample Image".rs,
    modifier = RemoteModifier.size(100.rdp),
)
import androidx.compose.remote.creation.compose.modifier.RemoteModifier
import androidx.compose.remote.creation.compose.modifier.size
import androidx.compose.remote.creation.compose.state.rdp
import androidx.compose.remote.creation.compose.state.rememberRemoteImageBitmap
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.remote.foundation.image.RemoteBasicImage
import androidx.compose.ui.layout.ContentScale

val remoteBitmap = rememberRemoteImageBitmap(url = "https://example.com/placeholder.png")
RemoteBasicImage(
    remoteBitmap = remoteBitmap,
    contentDescription = "Sample Image Fit".rs,
    modifier = RemoteModifier.size(100.rdp),
    contentScale = ContentScale.Fit,
)
Parameters
remoteBitmap: RemoteImageBitmap

the RemoteImageBitmap to be drawn.

contentDescription: RemoteString?

the Text used by accessibility services to describe what this image represents.

modifier: RemoteModifier = RemoteModifier

the RemoteModifier to be applied to this layout node.

contentScale: ContentScale = ContentScale.Fit

the rule to apply to scale the image when its size does not match the layout size, Defaults to ContentScale.Fit.

alpha: RemoteFloat = DefaultAlpha.rf

the Optional opacity to be applied to the remoteBitmap when it is rendered.