Size Struct
Represents a non-negative two-dimensional size, in pixels.
public readonly struct Size : IEquatable<Size>Remarks
A Size can be empty (zero width or height). APIs that create or resize images reject empty sizes with an ArgumentOutOfRangeException instead of silently clamping them.
- Implements
Constructors
| Name | Description |
|---|---|
| Size(int, int) | Initializes a new instance of the Size struct. |
Size(int, int)
Size.csProperties
| Name | Description |
|---|---|
| Area | Gets the number of pixels covered by this size, computed without overflow. |
| Empty | Gets a size whose width and height are zero. |
| Height | Gets the height, in pixels. |
| IsEmpty | Gets a value indicating whether the width or the height is zero. |
| Width | Gets the width, in pixels. |
Area
Size.csEmpty
Size.csHeight
Size.csIsEmpty
Size.csWidth
Size.csMethods
| Name | Description |
|---|---|
| Deconstruct(int, int) | Deconstructs the size into its width and height. |
| Equals(Size) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| GetHashCode() | Returns the hash code for this instance. |
| ToString() | Returns the size formatted as {Width}x{Height}. |
Deconstruct(int, int)
Size.csGetHashCode()
Size.csToString()
Size.csOperators
| Name | Description |
|---|---|
| operator ==(Size, Size) | Compares two sizes for equality. |
| operator !=(Size, Size) | Compares two sizes for inequality. |