Characteristic Locus
Inherited Members object.Equals(object, object) object.GetType() object.ReferenceEquals(object, object)
Namespace Meadow.Foundation.Graphics
Assembly MicroGraphics.dll

Syntax

public struct Size

Constructors

Size(Point)

Create a new size struct

Declaration
public Size(Point point)

Parameters

Type Name Description
Point point

Point values to set the width (x) and height (y)

Size(int, int)

Create a new size struct

Declaration
public Size(int width, int height)

Parameters

Type Name Description
int width

The initial width

int height

The initial height

Properties

Empty

Get an empty / zero size

Declaration
public static Size Empty { get; }

Property Value

Type Description
Size

Height

The height

Declaration
public int Height { readonly get; set; }

Property Value

Type Description
int

IsEmpty

Is the size empty / zero

Declaration
public bool IsEmpty { get; }

Property Value

Type Description
bool

Width

The width

Declaration
public int Width { readonly get; set; }

Property Value

Type Description
int

Methods

Equals(object)

Indicates whether this instance is equal to the specified object

Declaration
public override bool Equals(object obj)

Parameters

Type Name Description
object obj

The object instance to compare to

Returns

Type Description
bool

True if both instances are equal, false otherwise

Overrides

From(Point)

Get a size from a point

Declaration
public static Size From(Point point)

Parameters

Type Name Description
Point point

The point

Returns

Type Description
Size

A new Size struct

GetHashCode()

Returns the hash code for this instance

Declaration
public override int GetHashCode()

Returns

Type Description
int

An int that represents the hash code for this instance

Overrides

ToString()

Get a string representation of the Size

Declaration
public override string ToString()

Returns

Type Description
string

A string with the Width and Height

Overrides

Operators

operator +(Size, Size)

Add an amount to a Size in both dimensions

Declaration
public static Size operator +(Size size, Size amount)

Parameters

Type Name Description
Size size

The Size struct

Size amount

The amount to add

Returns

Type Description
Size

A new Size struct

operator ==(Size, Size)

Compares two instances for equality

Declaration
public static bool operator ==(Size left, Size right)

Parameters

Type Name Description
Size left

The first instance

Size right

The second instance

Returns

Type Description
bool

True if left is equal to right, false otherwise

operator !=(Size, Size)

Compares two instances for inequality

Declaration
public static bool operator !=(Size left, Size right)

Parameters

Type Name Description
Size left

The first instance

Size right

The second instance

Returns

Type Description
bool

True if left is not equal to right, false otherwise

operator -(Size, Size)

Subtract an amount from a Size in both dimensions

Declaration
public static Size operator -(Size size, Size amount)

Parameters

Type Name Description
Size size

The Size struct

Size amount

The amount to subtract

Returns

Type Description
Size

A new Size struct