<div class="meta" robots="noindex">

</div>

Class

# Realbasic.Size

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

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Size</api/graphics/size>` as a replacement.

</div>

## 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<realbasic.size.area>`     | `Integer</api/data_types/integer>` | ✓         |        |
| `Height<realbasic.size.height>` | `Integer</api/data_types/integer>` |           |        |
| `Width<realbasic.size.width>`   | `Integer</api/data_types/integer>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                       | Parameters                                                                                | Returns | Shared |
|--------------------------------------------|-------------------------------------------------------------------------------------------|---------|--------|
| `Clone<realbasic.size.clone>`              |                                                                                           |         |        |
| `Constructor<realbasic.size.constructor0>` | Width As `Integer</api/data_types/integer>`, Height As `Integer</api/data_types/integer>` |         |        |

## Property descriptions

<div id="realbasic.size.area">

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

</div>

<div class="rst-class">

forsearch

</div>

Realbasic.Size.Area

**Area** As `Integer</api/data_types/integer>`

Calculates the area of the object as the width times the height.

This property is read-only.

This example reads the Area property.

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

MsgBox(Str(rectSize.Area))
```

<div id="realbasic.size.height">

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

</div>

<div class="rst-class">

forsearch

</div>

Realbasic.Size.Height

**Height** As `Integer</api/data_types/integer>`

The height of the object, in pixels.

This example increases the height and width of the Size object.

``` xojo
Dim rectSize As New Realbasic.Size(100, 75)
rectSize.Height = 150
rectSize.Width = 200
```

<div id="realbasic.size.width">

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

</div>

<div class="rst-class">

forsearch

</div>

Realbasic.Size.Width

**Width** As `Integer</api/data_types/integer>`

The width of the object, in pixels.

This example increases the height and width of the Size object.

``` xojo
Dim rectSize As New Realbasic.Size(100, 75)
rectSize.Height = 150
rectSize.Width = 200
```

## Method descriptions

<div id="realbasic.size.clone">

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

</div>

<div class="rst-class">

forsearch

</div>

Realbasic.Size.Clone

**Clone**

Creates a duplicate <span class="title-ref">Realbasic.Size</span> object.

This example clones a <span class="title-ref">Realbasic.Size</span> object. The two Size objects have been added as properties to the window.

``` xojo
rectSize2 = rectSize.Clone
```

<div id="realbasic.size.constructor0">

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

</div>

<div class="rst-class">

forsearch

</div>

Realbasic.Size.Constructor

**Constructor**(Width as `Integer</api/data_types/integer>`, Height as `Integer</api/data_types/integer>`)

<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 Size object from the passed width and height.

``` xojo
Dim shapeSize As New Realbasic.Size(100, 75)
```

## Sample code

This example reads the Area property.

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

MsgBox(Str(rectSize.Area))
```

## Compatibility

All project types on all supported operating systems.

## See also

Object parent class; `Canvas</api/deprecated/canvas>` control; `Window</api/deprecated/window>`, `DesktopContainer</api/user_interface/desktop/desktopcontainer>`, `Point</api/graphics/point>`, `Rect</api/graphics/rect>` classes.
