Struct Size
Represents the size dimensions of an image with width and height values.
public readonly struct Size : IEquatable<Size>
- Implements
- Extension Methods
Remarks
Initializes a new instance of the Size struct with the specified dimensions.
Constructors
Size(float, float)
Represents the size dimensions of an image with width and height values.
public Size(float width, float height)
Parameters
Remarks
Initializes a new instance of the Size struct with the specified dimensions.
Properties
AspectRatio
Gets the aspect ratio calculated as width divided by height.
public float AspectRatio { get; }
Property Value
Height
Gets the height dimension in pixels.
public float Height { get; }
Property Value
Width
Gets the width dimension in pixels.
public float Width { get; }
Property Value
Methods
Equals(Size)
public bool Equals(Size other)
Parameters
otherSize
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(in Size, in Size)
Determines whether two Size instances are equal.
public static bool operator ==(in Size left, in Size right)
Parameters
Returns
- bool
trueif the sizes are equal; otherwise,false.
operator !=(in Size, in Size)
Determines whether two Size instances are not equal.
public static bool operator !=(in Size left, in Size right)
Parameters
Returns
- bool
trueif the sizes are not equal; otherwise,false.