Table of Contents

Struct SizeD

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

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(SKSize)

Initializes a new instance of the SizeD structure using the specified SKSize.

SizeD(Vector2)

Initializes a new instance of the SizeD struct from the specified Vector2.

SizeD(float)

Initializes a new instance of the SizeD struct.

SizeD(float, float)

Initializes a new instance of the SizeD class from the specified dimensions.

Fields

CoerceCoordFunc

Gets or sets coerce function used in Coerce() method. Default is Null. You can assign here for example Ceiling(float).

Default

Gets SizeD with width and height equal to -1.

Empty

Gets SizeD with zero width and height.

InflateDelta

Represents the default inflation delta used to adjust the size of a 2D object.

MinusOne

Gets SizeD with width and height equal to -1.

NaN

Gets SizeD with width and height equal to (NaN, NaN).

One

Gets SizeD with width and height equal to 1.

PositiveInfinity

Gets SizeD with width and height equal to PositiveInfinity.

Properties

Abs

Gets SizeD with absolute values of (Width, Height).

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.

Height

Represents the vertical component of this SizeD.

InfinityIfEmpty

Gets PositiveInfinity instead of width or height if their value is 0.

IsEmpty

Tests whether this SizeD has zero width and height.

IsInfinity

Gets a value indicating whether the size has a width or height that is positive or negative infinity.

IsNanHeight

Tests whether Height is not a number (equals NaN).

IsNanWidth

Tests whether Width is not a number (equals NaN).

IsNanWidthAndHeight

Tests whether both Width and Height are not numbers (equal to NaN).

IsNanWidthOrHeight

Tests whether Width or Height is not a number (equals NaN).

IsNegativeInfinity

Gets a value indicating whether the size has a width or height that is negative infinity.

IsPositive

Gets a value indicating whether both the width and height are greater than zero.

IsPositiveInfinity

Gets a value indicating whether the size has a width or height that is positive infinity.

MaxCoord

Represents a SizeD instance with both width and height set to maximum allowable coordinate value which can be used for the layout purposes.

MaxWidthHeight

Gets maximal of width and height.

MinWidthHeight

Gets minimal of width and height.

Width

Represents the horizontal component of this SizeD.

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(float) on values.

ClampTo(SizeD)

Returns a new SizeD instance with its dimensions clamped to the specified minimum values.

ClampToZero()

Clamps the values of the current SizeD instance to zero if they are less than zero.

Coerce()

Calls CoerceCoordFunc for the width and height.

Coerce(Func<float, float>)

Calls coerceFunc for the width and height.

CoerceHeight()

Calls CoerceCoordFunc for the height.

CoerceHeight(Func<float, float>)

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.

Deflate()

Deflates this SizeD by 1.

Deflated()

Creates a SizeD that is deflated by 1.

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.

GetSize(bool)

Gets Width or Height depending on vert parameter value.

GetWidths(SizeD[])

Returns an array filled with widths of the specified SizeD values.

InchesToDips()

Returns this size (in inches) converted to device-independent units.

Inflate()

Inflates this SizeD by 1.

Inflated()

Creates a SizeD that is inflated by 1.

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.

Min(SizeD, SizeD)

Gets minimal width and height from the two specified SizeD values.

Multiply(SizeD, float)

Multiplies SizeD by a value producing SizeD.

Parse(string)

Parse - returns an instance converted from the provided string using the culture "en-US"

string with Size data
PixelFromDip(float?)

Converts the current dimensions from device-independent pixels (DIPs) to physical pixels.

PixelToDip(float?)

Returns this size (in pixels) converted to device-independent units.

SetSize(bool, float)

Sets Width or Height depending on vert parameter value.

Shrink(bool, float)

Shrinks the specified size coordinate.

Shrink(float?, float?)

Get this object with applied min and max constraints.

Subtract(SizeD, SizeD)

Contracts a SizeD by another SizeD.

Sum(SizeD[])

Gets sum of the each element of the specified SizeD array.

SwapWidthAndHeight()

Swaps Width and Height values.

ToPointD()

Converts a SizeD structure to a PointD structure.

ToSize()

Converts a SizeD structure to a SizeI structure.

ToSkiaPoint()

Converts the current instance to an SKPoint.

ToSkiaSize()

Converts the current instance to an SKSize structure.

ToString()

Creates a human-readable string that represents this SizeD.

ToVector2()

Creates a new Vector2 from this object.

ValueIfEmpty(float)

Gets the specified value instead of width or height if their value less than or equal to 0.

WithSwappedWidthAndHeight()

Gets a new SizeD with swapped Width and Height values.

Operators

operator +(SizeD, SizeD)

Performs vector addition of two SizeD objects.

operator /(SizeD, float)

Divides SizeD by a value producing SizeD.

operator ==(SizeD, SizeD)

Tests whether two SizeD objects are identical.

explicit operator PointD(SizeD)

Converts the specified SizeD to a PointD.

explicit operator Vector2(SizeD)

Converts the specified SizeD to a Vector2.

explicit operator SizeD(Vector2)

Converts the specified Vector2 to a SizeD.

implicit operator SKSize(SizeD)

Converts a SizeD instance to an SKSize instance.

implicit operator Size(SizeD)

Creates a Size with the properties of the specified SizeD

implicit operator SizeD(SKSize)

Converts an SKSize to a SizeD.

implicit operator SizeD(Size)

Creates a SizeD with the properties of the specified Size

implicit operator SizeD(int)

Initializes SizeD with equal width and height.

implicit operator SizeD(float)

Initializes SizeD with equal width and height.

implicit operator SizeD((float Width, float Height))

Implicit operator conversion from tuple with two float values to SizeD.

operator !=(SizeD, SizeD)

Tests whether two SizeD objects are different.

operator *(SizeD, float)

Multiplies SizeD by a value producing SizeD.

operator *(float, SizeD)

Multiplies SizeD by a value producing SizeD.

operator -(SizeD, SizeD)

Subtracts a SizeD by another SizeD