Image
Composable Function
Android
@Composable
fun Image(
provider: ImageProvider,
contentDescription: String?,
modifier: GlanceModifier = GlanceModifier,
contentScale: ContentScale = ContentScale.Fit,
colorFilter: ColorFilter? = null,
) = ImageElement(provider, contentDescription, modifier, contentScale, colorFilter, alpha = null)
A composable which lays out and draws the image specified in provider
. This will attempt to lay
out the image using the intrinsic width and height of the provided image, but this can be
overridden by using a modifier to set the width or height of this element.
Parameters
provider | The image provider to use to draw the image |
contentDescription | text used by accessibility services to describe what this image represents. This should always be provided unless this image is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized. |
modifier | Modifier used to adjust the layout algorithm or draw decoration content. |
contentScale | How to lay the image out with respect to its bounds, if the bounds are smaller than the image. |
colorFilter | The effects to use to modify the color of an image. |
Android
@Composable
fun Image(
provider: ImageProvider,
contentDescription: String?,
@FloatRange(from = 0.0, to = 1.0) alpha: Float,
modifier: GlanceModifier = GlanceModifier,
contentScale: ContentScale = ContentScale.Fit,
colorFilter: ColorFilter? = null,
) = ImageElement(provider, contentDescription, modifier, contentScale, colorFilter, alpha)
A composable which lays out and draws the image specified in provider
. This will attempt to lay
out the image using the intrinsic width and height of the provided image, but this can be
overridden by using a modifier to set the width or height of this element.
Parameters
provider | The image provider to use to draw the image |
contentDescription | text used by accessibility services to describe what this image represents. This should always be provided unless this image is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized. |
alpha | Opacity (0f to 1f) to apply to the image. |
modifier | Modifier used to adjust the layout algorithm or draw decoration content. |
contentScale | How to lay the image out with respect to its bounds, if the bounds are smaller than the image. |
colorFilter | The effects to use to modify the color of an image. |