Class

# Size

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

An object used to represent the dimensions of an object.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                  | Type                             | Read-Only | Shared |
|-----------------------|----------------------------------|-----------|--------|
| `Area<size.area>`     | `Double</api/data_types/double>` | ✓         |        |
| `Height<size.height>` | `Double</api/data_types/double>` |           |        |
| `Width<size.width>`   | `Double</api/data_types/double>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                             | Parameters                                                                            | Returns                             | Shared |
|----------------------------------|---------------------------------------------------------------------------------------|-------------------------------------|--------|
| `Clone<size.clone>`              |                                                                                       | <span class="title-ref">Size</span> |        |
| `Constructor<size.constructor0>` |                                                                                       |                                     |        |
| `Constructor<size.constructor1>` | Width As `Double</api/data_types/double>`, Height As `Double</api/data_types/double>` |                                     |        |

## Property descriptions

<div id="size.area">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Size.Area

**Area** As `Double</api/data_types/double>`

> Calculates the area of the object as the width times the height.
>
> This property is read-only.
>
> This example reads the Area property.
>
> ``` xojo
> Var rectSize As New Size
> rectSize.Height = 150
> rectSize.Width = 200
>
> MessageBox(rectSize.Area.ToString)
> ```

<div id="size.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Size.Height

**Height** As `Double</api/data_types/double>`

> The height of the object, in pixels.
>
> This example increases the height and width of the <span class="title-ref">Size</span> object.
>
> ``` xojo
> Var rectSize As New Size(100, 75)
> rectSize.Height = 150
> rectSize.Width = 200
> ```

<div id="size.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Size.Width

**Width** As `Double</api/data_types/double>`

> The width of the object, in pixels.
>
> This example increases the height and width of the <span class="title-ref">Size</span> object.
>
> ``` xojo
> Var rectSize As New Size(100, 75)
> rectSize.Height = 150
> rectSize.Width = 200
> ```

## Method descriptions

<div id="size.clone">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Size.Clone

**Clone** As <span class="title-ref">Size</span>

> Creates a duplicate <span class="title-ref">Size</span> object.
>
> This example clones a <span class="title-ref">Size</span> object. The two <span class="title-ref">Size</span> objects have been added as properties to the window.
>
> ``` xojo
> rectSize2 = rectSize.Clone
> ```

<div id="size.constructor0">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Size.Constructor

**Constructor**

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Creates a <span class="title-ref">Size</span> object with a <span class="title-ref">Size</span> of 0, 0.

<div id="size.constructor1">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Size.Constructor

**Constructor**(Width As `Double</api/data_types/double>`, Height As `Double</api/data_types/double>`)

> Creates a <span class="title-ref">Size</span> object from the passed width and height.
>
> ``` xojo
> Var shapeSize As New Size(100, 75)
> ```

## Sample code

This example reads the Area property.

``` xojo
Var rectSize As New Size
rectSize.Height = 150
rectSize.Width = 200

MessageBox(rectSize.Area.ToString)
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

Object parent class; `DesktopCanvas</api/user_interface/desktop/desktopcanvas>` control; `DesktopWindow</api/user_interface/desktop/desktopwindow>`, `DesktopContainer</api/user_interface/desktop/desktopcontainer>`, `Point</api/graphics/point>`, `Rect</api/graphics/rect>` classes.

</div>
