---
title: "IntSize"
description: "A two-dimensional size class used for measuring in [Int] pixels.

To create an [IntSize], call the top-level function that accepts a width/height pair of
dimensions:
```
val size = IntSize(width, height)
```

The primary constructor of [IntSize] is intended to be used with the [packedValue] property to
allow storing sizes in arrays or collections of primitives without boxing."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
value class IntSize @PublishedApi internal constructor(val packedValue: Long)
```


A two-dimensional size class used for measuring in `Int` pixels.

To create an `IntSize`, call the top-level function that accepts a width/height pair of
dimensions:
```
val size = IntSize(width, height)
```

The primary constructor of `IntSize` is intended to be used with the `packedValue` property to
allow storing sizes in arrays or collections of primitives without boxing.

#### Parameters

| | |
| --- | --- |
| packedValue | `Long` value encoding the `width` and `height` components of the `IntSize`. Encoded values can be obtained by using the `packedValue` property of existing `IntSize` instances. |



## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline val width: Int
```


The horizontal aspect of the size in `Int` pixels.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline val height: Int
```


The vertical aspect of the size in `Int` pixels.



## Functions

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

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

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


Returns an IntSize scaled by multiplying `width` and `height` by `other`


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


Returns an IntSize scaled by dividing `width` and `height` by `other`


## Companion Object

#### Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val Zero = IntSize(0L)
```


IntSize with a zero (0) width and height.





