Struct SizeD
Represents the size of a rectangular region with an ordered pair of width and height.
[Serializable]
public struct SizeD : IEquatable<SizeD>
- Implements
Constructors
- SizeD(PointD)
Initializes a new instance of the SizeD class from the specified PointD.
- SizeD(SizeD)
Initializes a new instance of the SizeD class from the specified existing SizeD.
- SizeD(double)
Initializes a new instance of the SizeD struct.
- SizeD(double, double)
Initializes a new instance of the SizeD class from the specified dimensions.
- SizeD(Vector2)
Initializes a new instance of the SizeD struct from the specified Vector2.
Fields
- CoerceCoordFunc
Gets or sets coerce function used in Coerce() method. Default is Null. You can assign here for example Ceiling(double).
- PositiveInfinity
Gets SizeD with width and height equal to PositiveInfinity.
Properties
- AnyIsEmpty
Tests whether this SizeD has zero width or height.
- AnyIsEmptyOrNegative
Tests whether this SizeD has zero (or negative) width or height.
- Diagonal
Gets diagonal of the rectangle with height and width specified in this object.
- InfinityIfEmpty
Gets PositiveInfinity instead of width or height if their value is 0.
- IsNanWidthAndHeight
Tests whether both Width and Height are not numbers (equal to NaN).
- MaxWidthHeight
Gets maximal of width and height.
- MinWidthHeight
Gets minimal of width and height.
Methods
- Add(SizeD, SizeD)
Performs vector addition of two SizeD objects.
- AnyIsNaN(SizeD)
Determines whether the specified value has width or height equal to NaN.
- ApplyMax(SizeD)
Gets size with applied maximal limitations.
- ApplyMin(SizeD)
Gets size with applied minimal limitations.
- ApplyMinMax(SizeD, SizeD)
Gets size with applied minimal and maximal limitations.
- Ceiling()
Returns new SizeD value with ceiling of the Width and Height. Uses Ceiling(double) on values.
- Coerce()
Calls CoerceCoordFunc for the width and height.
- Coerce(Func<double, double>)
Calls
coerceFunc
for the width and height.
- CoerceHeight()
Calls CoerceCoordFunc for the height.
- CoerceHeight(Func<double, double>)
Calls
coerceFunc
for the height.
- ConvertToString(string, IFormatProvider)
Creates a string representation of this object based on the format string and IFormatProvider passed in. If the provider is null, the CurrentCulture is used. See the documentation for IFormattable for more information.
- Equals(SizeD)
Indicates whether the current object is equal to another object of the same type.
- Equals(object?)
Tests to see whether the specified object is a SizeD with the same dimensions as this SizeD.
- GetHashCode()
Serves as the default hash function.
- GetHeights(SizeD[])
Returns an array filled with heights of the specified SizeD values.
- GetWidths(SizeD[])
Returns an array filled with widths of the specified SizeD values.
- InchesToDips()
Returns this size (in inches) converted to device-independent units.
- IsNaN(SizeD)
Determines whether the specified value is (NaN, NaN).
- Max(SizeD, SizeD)
Gets maximal width and height from the two specified SizeD values.
- MaxWidthHeights(SizeD[])
Returns the larger of the specified SizeD values.
- MillimetersToDips()
Returns this size (in millimeters) converted to device-independent units.
- Parse(string)
Parse - returns an instance converted from the provided string using the culture "en-US"
string with Size data
- PixelToDip(double?)
Returns this size (in pixels) converted to device-independent units.
- Shrink(bool, double)
Shrinks the specified size coordinate.
- Shrink(double?, double?)
Get this object with applied min and max constraints.
- Sum(SizeD[])
Gets sum of the each element of the specified SizeD array.
- ToString()
Creates a human-readable string that represents this SizeD.
- ToVector2()
Creates a new Vector2 from this object.
Operators
- operator +(SizeD, SizeD)
Performs vector addition of two SizeD objects.
- operator ==(SizeD, SizeD)
Tests whether two SizeD objects are identical.
- implicit operator SizeD(double)
Initializes SizeD with equal width and hegiht.
- implicit operator SizeD(int)
Initializes SizeD with equal width and hegiht.
- implicit operator SizeD((double, double))
Implicit operator convertion from tuple with two double values to SizeD.
- operator !=(SizeD, SizeD)
Tests whether two SizeD objects are different.