Table of Contents

Struct Size

Namespace
System.Drawing
Assembly
nanoFramework.Graphics.Core.dll

Represents the size of a rectangular region with an ordered pair of width and height.

public struct Size
Inherited Members

Constructors

Size(Point)

Initializes a new instance of the Size class from the specified Point.

public Size(Point pt)

Parameters

pt Point

Size(int, int)

Initializes a new instance of the Size class from the specified dimensions.

public Size(int width, int height)

Parameters

width int
height int

Fields

Empty

Initializes a new instance of the Size class.

public static readonly Size Empty

Field Value

Size

Properties

Height

Represents the vertical component of this Size.

public int Height { readonly get; set; }

Property Value

int

IsEmpty

Tests whether this Size has zero width and height.

public readonly bool IsEmpty { get; }

Property Value

bool

Width

Represents the horizontal component of this Size.

public int Width { readonly get; set; }

Property Value

int

Methods

Add(Size, Size)

Performs vector addition of two Size objects.

public static Size Add(Size sz1, Size sz2)

Parameters

sz1 Size
sz2 Size

Returns

Size

Equals(Size)

Tests to see whether the specified object is a Size with the same dimensions as this Size.

public readonly bool Equals(Size other)

Parameters

other Size

Returns

bool

Equals(object?)

Tests to see whether the specified object is a Size with the same dimensions as this Size.

public override readonly bool Equals(object? other)

Parameters

other object

Returns

bool

GetHashCode()

Returns a hash code.

public override readonly int GetHashCode()

Returns

int

Subtract(Size, Size)

Contracts a Size by another Size .

public static Size Subtract(Size sz1, Size sz2)

Parameters

sz1 Size
sz2 Size

Returns

Size

ToString()

Creates a human-readable string that represents this Size.

public override readonly string ToString()

Returns

string

Operators

operator +(Size, Size)

Performs vector addition of two Size objects.

public static Size operator +(Size sz1, Size sz2)

Parameters

sz1 Size
sz2 Size

Returns

Size

operator /(Size, int)

Divides Size by an int producing Size.

public static Size operator /(Size left, int right)

Parameters

left Size

Dividend of type Size.

right int

Divisor of type int.

Returns

Size

Result of type Size.

operator ==(Size, Size)

Tests whether two Size objects are identical.

public static bool operator ==(Size sz1, Size sz2)

Parameters

sz1 Size
sz2 Size

Returns

bool

explicit operator Point(Size)

Converts the specified Size to a Point.

public static explicit operator Point(Size size)

Parameters

size Size

Returns

Point

operator !=(Size, Size)

Tests whether two Size objects are different.

public static bool operator !=(Size sz1, Size sz2)

Parameters

sz1 Size
sz2 Size

Returns

bool

operator *(Size, int)

Multiplies Size by an int producing Size.

public static Size operator *(Size left, int right)

Parameters

left Size

Multiplicand of type Size.

right int

Multiplier of type int.

Returns

Size

Product of type Size.

operator *(int, Size)

Multiplies a Size by an int producing Size.

public static Size operator *(int left, Size right)

Parameters

left int

Multiplier of type int.

right Size

Multiplicand of type Size.

Returns

Size

Product of type Size.

operator -(Size, Size)

Contracts a Size by another Size

public static Size operator -(Size sz1, Size sz2)

Parameters

sz1 Size
sz2 Size

Returns

Size