# ContentScale

Artifact: [androidx.glance:glance](https://developer.android.com/jetpack/androidx/releases/glance) [View Source](https://cs.android.com/search?q=file:androidx/glance/layout/ContentScale.kt+class:androidx.glance.layout.ContentScale) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)


```
value class ContentScale
```

<br />

*** ** * ** ***

Scaling to be used when an element is smaller than its available bounds. Mainly used by `https://developer.android.com/reference/kotlin/androidx/glance/Image.composable#Image(androidx.glance.ImageProvider,kotlin.String,androidx.glance.GlanceModifier,androidx.glance.layout.ContentScale,androidx.glance.ColorFilter)` to dictate how the image should be drawn within the `https://developer.android.com/reference/kotlin/androidx/glance/Image.composable#Image(androidx.glance.ImageProvider,kotlin.String,androidx.glance.GlanceModifier,androidx.glance.layout.ContentScale,androidx.glance.ColorFilter)` element's bounding box.

## Summary

| ### Public companion properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/layout/ContentScale` | `https://developer.android.com/reference/kotlin/androidx/glance/layout/ContentScale#Crop()` Scale the source uniformly (maintaining the source's aspect ratio) so that both dimensions (width and height) of the source will be equal to or larger than the corresponding dimension of the destination. |
| `https://developer.android.com/reference/kotlin/androidx/glance/layout/ContentScale` | `https://developer.android.com/reference/kotlin/androidx/glance/layout/ContentScale#FillBounds()` Scale horizontal and vertically non-uniformly to fill the destination bounds. |
| `https://developer.android.com/reference/kotlin/androidx/glance/layout/ContentScale` | `https://developer.android.com/reference/kotlin/androidx/glance/layout/ContentScale#Fit()` Scale the source uniformly (maintaining the source's aspect ratio) so that both dimensions (width and height) of the source will be equal to or less than the corresponding dimension of the destination |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/glance/layout/ContentScale#ContentScale(kotlin.Int)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

## Public companion properties

### Crop

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val Crop: ContentScale
```

Scale the source uniformly (maintaining the source's aspect ratio) so that both dimensions (width and height) of the source will be equal to or larger than the corresponding dimension of the destination.

### FillBounds

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val FillBounds: ContentScale
```

Scale horizontal and vertically non-uniformly to fill the destination bounds.

### Fit

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
val Fit: ContentScale
```

Scale the source uniformly (maintaining the source's aspect ratio) so that both dimensions (width and height) of the source will be equal to or less than the corresponding dimension of the destination

## Public constructors

### ContentScale

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/glance#1.0.0)

```
ContentScale(value: Int)
```