Stay organized with collections
Save and categorize content based on your preferences.
Size
open class Size
Image size (width and height dimensions).
Summary
Public constructors |
Sets the dimensions for pictures.
|
Public methods |
open Boolean |
Compares obj to this size.
|
open Int |
|
Properties |
Int |
height of the picture
|
Int |
width of the picture
|
Public constructors
Size
Size(
w: Int,
h: Int)
Sets the dimensions for pictures.
Parameters |
w |
Int: the photo width (pixels) |
h |
Int: the photo height (pixels) |
Public methods
equals
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 |
true if the width and height of obj is the same as those of this size. false otherwise. |
hashCode
open fun hashCode(): Int
Deprecated: Deprecated in Java.
Return |
Int |
a hash code value for this object. |
Properties
height
var height: Int
Deprecated: Deprecated in Java.
height of the picture
width
var width: Int
Deprecated: Deprecated in Java.
width of the picture
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Camera.Size\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nSize\n====\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/hardware/Camera.Size \"View this page in Java\") \n\n```\nopen class Size\n```\n\n|---|-----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.hardware.Camera.Size](#) |\n\n*** ** * ** ***\n\n| **This class was deprecated in API level 21.**\n|\n| We recommend using the new [android.hardware.camera2](/reference/kotlin/android/hardware/camera2/package-summary) API for new applications.\n\nImage size (width and height dimensions).\n\nSummary\n-------\n\n| Public constructors ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [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. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Compares `obj` to this size. |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](#hashCode())`()` \u003cbr /\u003e |\n\n| Properties ||\n|----------------------------------------------------------------------------|----------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [height](#height:kotlin.Int) height of the picture |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [width](#width:kotlin.Int) width of the picture |\n\nPublic constructors\n-------------------\n\n### Size\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nSize(\n w: Int, \n h: Int)\n```\n\nSets the dimensions for pictures.\n\n| Parameters ||\n|-----|-------------------------------------------------------------------------------------------------------|\n| `w` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the photo width (pixels) |\n| `h` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the photo height (pixels) |\n\nPublic methods\n--------------\n\n### equals\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun equals(other: Any?): Boolean\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCompares `obj` to this size.\n\n| Parameters ||\n|-------|-----------------------------------------------------------------|\n| `obj` | the object to compare this size with. This value may be `null`. |\n\n| Return ||\n|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| [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. |\n\n### hashCode\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun hashCode(): Int\n```\n\n**Deprecated:** *Deprecated in Java.*\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |\n\nProperties\n----------\n\n### height\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar height: Int\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nheight of the picture \n\n### width\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar width: Int\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nwidth of the picture"]]