Skip to content
CShift0.45

Size

Struct · namespace System.Drawing · Since 0.45

struct Size : IEquatable<Size>, IHashable

A size in pixels.

Name Description
Width The width.
Height The height.
int Width

The width.

int Height

The height.

Name Description
Create A size of width x height.
static Size Create(int width, int height)

A size of width x height.

Name Description
IsEmpty Whether the width or the height is 0 or less.
Area The number of pixels (0 for an empty size).
Scale Both sides multiplied by factor.
Equals Whether both sides are equal.
GetHashCode A hash code of both sides.
ToString “width x height”.
bool IsEmpty()

Whether the width or the height is 0 or less.

int Area()

The number of pixels (0 for an empty size).

Size Scale(int factor)

Both sides multiplied by factor.

bool Equals(Size other)

Whether both sides are equal.

int GetHashCode()

A hash code of both sides.

string ToString()

“width x height”.