Struct SizeF
Stores an ordered pair of single precision floating points, which specify a height and width.
Implements
Namespace: SixLabors.ImageSharp
Assembly: SixLabors.ImageSharp.dll
Syntax
public struct SizeF
Remarks
This struct is fully mutable. This is done (against the guidelines) for the sake of performance, as it avoids the need to create new values for modification operations.
Constructors
| Improve this Doc View SourceSizeF(PointF)
Declaration
public SizeF(PointF point)
Parameters
Type | Name | Description |
---|---|---|
PointF | point | The point. |
SizeF(SizeF)
Initializes a new instance of the SizeF struct.
Declaration
public SizeF(SizeF size)
Parameters
Type | Name | Description |
---|---|---|
SizeF | size | The size. |
SizeF(Single, Single)
Initializes a new instance of the SizeF struct.
Declaration
public SizeF(float width, float height)
Parameters
Type | Name | Description |
---|---|---|
Single | width | The width of the size. |
Single | height | The height of the size. |
Fields
| Improve this Doc View SourceEmpty
Represents a SizeF that has Width and Height values set to zero.
Declaration
public static readonly SizeF Empty
Field Value
Type | Description |
---|---|
SizeF |
Properties
| Improve this Doc View SourceHeight
Gets or sets the height of this SizeF.
Declaration
public float Height { readonly get; set; }
Property Value
Type | Description |
---|---|
Single |
IsEmpty
Gets a value indicating whether this SizeF is empty.
Declaration
public readonly bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
Boolean |
Width
Gets or sets the width of this SizeF.
Declaration
public float Width { readonly get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
| Improve this Doc View SourceAdd(SizeF, SizeF)
Performs vector addition of two SizeF objects.
Declaration
public static SizeF Add(SizeF left, SizeF right)
Parameters
Type | Name | Description |
---|---|---|
SizeF | left | The size on the left hand of the operand. |
SizeF | right | The size on the right hand of the operand. |
Returns
Type | Description |
---|---|
SizeF | The SizeF. |
Deconstruct(out Single, out Single)
Deconstructs this size into two floats.
Declaration
public void Deconstruct(out float width, out float height)
Parameters
Type | Name | Description |
---|---|---|
Single | width | The out value for the width. |
Single | height | The out value for the height. |
Equals(SizeF)
Declaration
public bool Equals(SizeF other)
Parameters
Type | Name | Description |
---|---|---|
SizeF | other |
Returns
Type | Description |
---|---|
Boolean |
Equals(Nullable<Object>)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Object> | obj |
Returns
Type | Description |
---|---|
Boolean |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Subtract(SizeF, SizeF)
Declaration
public static SizeF Subtract(SizeF left, SizeF right)
Parameters
Type | Name | Description |
---|---|---|
SizeF | left | The size on the left hand of the operand. |
SizeF | right | The size on the right hand of the operand. |
Returns
Type | Description |
---|---|
SizeF | The SizeF. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Transform(SizeF, Matrix3x2)
Transforms a size by the given matrix.
Declaration
public static SizeF Transform(SizeF size, Matrix3x2 matrix)
Parameters
Type | Name | Description |
---|---|---|
SizeF | size | The source size. |
Matrix3x2 | matrix | The transformation matrix. |
Returns
Type | Description |
---|---|
SizeF | A transformed size. |
Operators
| Improve this Doc View SourceAddition(SizeF, SizeF)
Computes the sum of adding two sizes.
Declaration
public static SizeF operator +(SizeF left, SizeF right)
Parameters
Type | Name | Description |
---|---|---|
SizeF | left | The size on the left hand of the operand. |
SizeF | right | The size on the right hand of the operand. |
Returns
Type | Description |
---|---|
SizeF | The SizeF. |
Division(SizeF, Single)
Declaration
public static SizeF operator /(SizeF left, float right)
Parameters
Type | Name | Description |
---|---|---|
SizeF | left | Dividend of type SizeF. |
Single | right | Divisor of type |
Returns
Type | Description |
---|---|
SizeF | Result of type SizeF. |
Equality(SizeF, SizeF)
Compares two SizeF objects for equality.
Declaration
public static bool operator ==(SizeF left, SizeF right)
Parameters
Type | Name | Description |
---|---|---|
SizeF | left | The size on the left hand of the operand. |
SizeF | right | The size on the right hand of the operand. |
Returns
Type | Description |
---|---|
Boolean | True if the current left is equal to the |
Explicit(SizeF to PointF)
Declaration
public static explicit operator PointF(SizeF size)
Parameters
Type | Name | Description |
---|---|---|
SizeF | size | The size. |
Returns
Type | Description |
---|---|
PointF |
Explicit(SizeF to Size)
Declaration
public static explicit operator Size(SizeF size)
Parameters
Type | Name | Description |
---|---|---|
SizeF | size | The size. |
Returns
Type | Description |
---|---|
Size | The Size. |
Implicit(SizeF to Vector2)
Creates a
Declaration
public static implicit operator Vector2(SizeF point)
Parameters
Type | Name | Description |
---|---|---|
SizeF | point | The point. |
Returns
Type | Description |
---|---|
Vector2 | The |
Inequality(SizeF, SizeF)
Compares two SizeF objects for inequality.
Declaration
public static bool operator !=(SizeF left, SizeF right)
Parameters
Type | Name | Description |
---|---|---|
SizeF | left | The size on the left hand of the operand. |
SizeF | right | The size on the right hand of the operand. |
Returns
Type | Description |
---|---|
Boolean | True if the current left is unequal to the |
Multiply(SizeF, Single)
Declaration
public static SizeF operator *(SizeF left, float right)
Parameters
Type | Name | Description |
---|---|---|
SizeF | left | Multiplicand of type SizeF. |
Single | right | Multiplier of type |
Returns
Type | Description |
---|---|
SizeF | Product of type SizeF. |
Multiply(Single, SizeF)
Declaration
public static SizeF operator *(float left, SizeF right)
Parameters
Type | Name | Description |
---|---|---|
Single | left | Multiplier of type |
SizeF | right | Multiplicand of type SizeF. |
Returns
Type | Description |
---|---|
SizeF | Product of type SizeF. |
Subtraction(SizeF, SizeF)
Computes the difference left by subtracting one size from another.
Declaration
public static SizeF operator -(SizeF left, SizeF right)
Parameters
Type | Name | Description |
---|---|---|
SizeF | left | The size on the left hand of the operand. |
SizeF | right | The size on the right hand of the operand. |
Returns
Type | Description |
---|---|
SizeF | The SizeF. |