Class

Realbasic.Size


Warning

This item was deprecated in version 2019r2. Please use Size as a replacement.

Description

An object used to represent the dimensions of an object.

Properties

Name

Type

Read-Only

Shared

Area

Integer

Height

Integer

Width

Integer

Methods

Name

Parameters

Returns

Shared

Clone

Constructor

Width As Integer, Height As Integer

Property descriptions


Realbasic.Size.Area

Area As Integer

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

This property is read-only.

This example reads the Area property.

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

MsgBox(Str(rectSize.Area))

Realbasic.Size.Height

Height As Integer

The height of the object, in pixels.

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

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

Realbasic.Size.Width

Width As Integer

The width of the object, in pixels.

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

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

Method descriptions


Realbasic.Size.Clone

Clone

Creates a duplicate Realbasic.Size object.

This example clones a Realbasic.Size object. The two Size objects have been added as properties to the window.

rectSize2 = rectSize.Clone

Realbasic.Size.Constructor

Constructor(Width as Integer, Height as Integer)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a Size object from the passed width and height.

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

Sample code

This example reads the Area property.

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 control; Window, DesktopContainer, Point, Rect classes.