# IntSize

Artifact: [androidx.compose.ui:ui-unit](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/unit/IntSize.kt+class:androidx.compose.ui.unit.IntSize) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  value class IntSize
  ```

*** ** * ** ***

A two-dimensional size class used for measuring in `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixels.

To create an `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize`, call the top-level function that accepts a width/height pair of dimensions:

```kotlin
val size = IntSize(width, height)
```

The primary constructor of `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` is intended to be used with the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#packedValue()` property to allow storing sizes in arrays or collections of primitives without boxing.

## Summary

| ### Nested types |
|---|
| `object https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize.Companion` |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#Zero()` IntSize with a zero (0) width and height. | Cmn |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#IntSize(kotlin.Long)(packedValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` | Cmn |

| ### Public functions |
|---|---|---|
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#component1()()` | Cmn |
| `inline operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#component2()()` | Cmn |
| `operator https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#div(kotlin.Int)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns an IntSize scaled by dividing `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#width()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#height()` by `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#div(kotlin.Int)` | Cmn |
| `operator https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#times(kotlin.Int)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns an IntSize scaled by multiplying `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#width()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#height()` by `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#times(kotlin.Int)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#height()` The vertical aspect of the size in `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixels. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#packedValue()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` value encoding the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#width()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#height()` components of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#width()` The horizontal aspect of the size in `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixels. | Cmn |

| ### Extension functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntRect` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#(androidx.compose.ui.unit.IntSize).toIntRect()()` Convert a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntRect`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#(androidx.compose.ui.unit.IntSize).toSize()()` | Cmn |

| ### Extension properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#(androidx.compose.ui.unit.IntSize).center()` Returns the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` of the center of the rect from the point of 0, 0 with this `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize`. | Cmn |

## Public companion properties

### Zero

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0)

```
val Zero: IntSize
```

IntSize with a zero (0) width and height.

## Public constructors

### IntSize

Cmn Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.13.0-rc01)

```
IntSize(packedValue: Long)
```

| Parameters |
|---|---|
| `packedValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` value encoding the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#width()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#height()` components of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize`. Encoded values can be obtained by using the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#packedValue()` property of existing `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` instances. |

## Public functions

### component1

Cmn Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.1.0)

```
inline operator fun component1(): Int
```

### component2

Cmn Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.1.0)

```
inline operator fun component2(): Int
```

### div

Cmn Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.1.0)

```
operator fun div(other: Int): IntSize
```

Returns an IntSize scaled by dividing `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#width()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#height()` by `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#div(kotlin.Int)`

### times

Cmn Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.1.0)

```
operator fun times(other: Int): IntSize
```

Returns an IntSize scaled by multiplying `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#width()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#height()` by `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#times(kotlin.Int)`

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### height

Cmn Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
val height: Int
```

The vertical aspect of the size in `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixels.

### packedValue

Cmn Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.8.0)

```
val packedValue: Long
```

`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` value encoding the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#width()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#height()` components of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize`. Encoded values can be obtained by using the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize#packedValue()` property of existing `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` instances.

### width

Cmn Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
val width: Int
```

The horizontal aspect of the size in `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` pixels.

## Extension functions

### IntSize.toIntRect

Cmn Artifact: [androidx.compose.ui:ui-unit](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/unit/IntSize.kt+function:toIntRect)

```
fun IntSize.toIntRect(): IntRect
```

Convert a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize` to a `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntRect`.

### IntSize.toSize

Cmn Artifact: [androidx.compose.ui:ui-unit](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/unit/IntSize.kt+function:toSize)

```
fun IntSize.toSize(): Size
```

## Extension properties

### IntSize.center

Cmn Artifact: [androidx.compose.ui:ui-unit](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/unit/IntSize.kt+symbol:center)

```
val IntSize.center: IntOffset
```

Returns the `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntOffset` of the center of the rect from the point of 0, 0 with this `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/IntSize`.