Size
Struct · namespace System.Drawing · Since 0.45
struct Size : IEquatable<Size>, IHashableA size in pixels.
Fields
Section titled “Fields”| Name | Description |
|---|---|
Width |
The width. |
Height |
The height. |
int WidthThe width.
Height
Section titled “Height”int HeightThe height.
Static methods
Section titled “Static methods”| Name | Description |
|---|---|
Create |
A size of width x height. |
Create
Section titled “Create”static Size Create(int width, int height)A size of width x height.
Methods
Section titled “Methods”| 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”. |
IsEmpty
Section titled “IsEmpty”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.
Equals
Section titled “Equals”bool Equals(Size other)Whether both sides are equal.
GetHashCode
Section titled “GetHashCode”int GetHashCode()A hash code of both sides.
ToString
Section titled “ToString”string ToString()“width x height”.