# Camera.Size

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Size

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/hardware/Camera.Size "View this page in Java")  

```
open class Size
```

|---|--------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                               ||
| ↳ | [android.hardware.Camera.Size](https://developer.android.com/reference/kotlin/android/hardware/Camera.Size#) |

*** ** * ** ***

| **This class was deprecated in API level 21.**
|
| We recommend using the new[android.hardware.camera2](https://developer.android.com/reference/kotlin/android/hardware/camera2/package-summary)API for new applications.

Image size (width and height dimensions).

## Summary

|                                                                                                                                                       Public constructors                                                                                                                                                       ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Size](https://developer.android.com/reference/kotlin/android/hardware/Camera.Size#Size(kotlin.Int,%20kotlin.Int))`(`w:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `h:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the dimensions for pictures. |

|                                                                                                                                                    Public methods                                                                                                                                                     ||
|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/android/hardware/Camera.Size#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Compares`obj`to this size. |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)         | [hashCode](https://developer.android.com/reference/kotlin/android/hardware/Camera.Size#hashCode())`()` <br />                                                                                                                 |

|                                                                                                Properties                                                                                                 ||
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [height](https://developer.android.com/reference/kotlin/android/hardware/Camera.Size#height:kotlin.Int) height of the picture |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [width](https://developer.android.com/reference/kotlin/android/hardware/Camera.Size#width:kotlin.Int) width of the picture    |

## Public constructors

### Size

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
Size(
    w: Int, 
    h: Int)
```

Sets the dimensions for pictures.

|                                                Parameters                                                 ||
|-----|------------------------------------------------------------------------------------------------------|
| `w` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the photo width (pixels)  |
| `h` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the photo height (pixels) |

## Public methods

### equals

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun equals(other: Any?): Boolean
```

**Deprecated:** *Deprecated in Java.*

Compares`obj`to this size.

|                              Parameters                               ||
|-------|----------------------------------------------------------------|
| `obj` | the object to compare this size with. This value may be`null`. |

|                                                                                    Return                                                                                    ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if the width and height of`obj`is the same as those of this size.`false`otherwise. |

### hashCode

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun hashCode(): Int
```

**Deprecated:** *Deprecated in Java.*

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |

## Properties

### height

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
var height: Int
```

**Deprecated:** *Deprecated in Java.*

height of the picture  

### width

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
var width: Int
```

**Deprecated:** *Deprecated in Java.*

width of the picture