# resizeWithContentScale

## Functions summary

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/media3/ui/compose/modifiers/resizeWithContentScale.modifier#(androidx.compose.ui.Modifier).resizeWithContentScale(androidx.compose.ui.layout.ContentScale,kotlin.Float,androidx.compose.ui.Alignment)( contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale, aspectRatio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html?, alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment )` Attempts to size the original content rectangle to be inscribed into a destination by applying a specified `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale` type. |

## Functions

### Modifier.resizeWithContentScale

Artifact: [androidx.media3:media3-ui-compose](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/ui/compose/modifiers/extensions.kt+function:resizeWithContentScale)

```
@UnstableApi
fun Modifier.resizeWithContentScale(
    contentScale: ContentScale,
    aspectRatio: Float?,
    alignment: Alignment = Alignment.Center
): Modifier
```

Attempts to size the original content rectangle to be inscribed into a destination by applying a specified `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale` type.

| Parameters |
|---|---|
| `contentScale: https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale` to apply to the content. |
| `aspectRatio: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html?` | The aspect ratio of the content (width / height). If null, no scaling is applied. |
| `alignment: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment = Alignment.Center` | The `https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment` used to position the scaled content within the destination. If the scaled content overflows the destination, e.g. with `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/ContentScale#Crop()`, the alignment determines which part of the content lies within the destination. |