Struct SizeF
- Namespace
- SixLabors.ImageSharp
- Assembly
- SixLabors.ImageSharp.dll
Stores an ordered pair of single precision floating points, which specify a height and width.
public struct SizeF : IEquatable<SizeF>
- Implements
- Inherited Members
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
SizeF(PointF)
public SizeF(PointF point)
Parameters
pointPointFThe point.
SizeF(SizeF)
Initializes a new instance of the SizeF struct.
public SizeF(SizeF size)
Parameters
sizeSizeFThe size.
SizeF(float, float)
Initializes a new instance of the SizeF struct.
public SizeF(float width, float height)
Parameters
Fields
Empty
Represents a SizeF that has Width and Height values set to zero.
public static readonly SizeF Empty
Field Value
Properties
Height
Gets or sets the height of this SizeF.
public float Height { readonly get; set; }
Property Value
Width
Gets or sets the width of this SizeF.
public float Width { readonly get; set; }
Property Value
Methods
Add(SizeF, SizeF)
Performs vector addition of two SizeF objects.
public static SizeF Add(SizeF left, SizeF right)
Parameters
leftSizeFThe size on the left hand of the operand.
rightSizeFThe size on the right hand of the operand.
Returns
Deconstruct(out float, out float)
Deconstructs this size into two floats.
public void Deconstruct(out float width, out float height)
Parameters
Equals(SizeF)
public bool Equals(SizeF other)
Parameters
otherSizeF
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Subtract(SizeF, SizeF)
public static SizeF Subtract(SizeF left, SizeF right)
Parameters
leftSizeFThe size on the left hand of the operand.
rightSizeFThe size on the right hand of the operand.
Returns
ToString()
public override string ToString()
Returns
Transform(SizeF, Matrix3x2)
Transforms a size by the given matrix.
public static SizeF Transform(SizeF size, Matrix3x2 matrix)
Parameters
Returns
- SizeF
A transformed size.
Operators
operator +(SizeF, SizeF)
Computes the sum of adding two sizes.
public static SizeF operator +(SizeF left, SizeF right)
Parameters
leftSizeFThe size on the left hand of the operand.
rightSizeFThe size on the right hand of the operand.
Returns
operator /(SizeF, float)
public static SizeF operator /(SizeF left, float right)
Parameters
Returns
operator ==(SizeF, SizeF)
Compares two SizeF objects for equality.
public static bool operator ==(SizeF left, SizeF right)
Parameters
leftSizeFThe size on the left hand of the operand.
rightSizeFThe size on the right hand of the operand.
Returns
- bool
True if the current left is equal to the
rightparameter; otherwise, false.
explicit operator PointF(SizeF)
public static explicit operator PointF(SizeF size)
Parameters
sizeSizeFThe size.
Returns
explicit operator Size(SizeF)
public static explicit operator Size(SizeF size)
Parameters
sizeSizeFThe size.
Returns
implicit operator Vector2(SizeF)
public static implicit operator Vector2(SizeF point)
Parameters
pointSizeFThe point.
Returns
operator !=(SizeF, SizeF)
Compares two SizeF objects for inequality.
public static bool operator !=(SizeF left, SizeF right)
Parameters
leftSizeFThe size on the left hand of the operand.
rightSizeFThe size on the right hand of the operand.
Returns
- bool
True if the current left is unequal to the
rightparameter; otherwise, false.
operator *(SizeF, float)
public static SizeF operator *(SizeF left, float right)
Parameters
Returns
operator *(float, SizeF)
public static SizeF operator *(float left, SizeF right)
Parameters
Returns
operator -(SizeF, SizeF)
Computes the difference left by subtracting one size from another.
public static SizeF operator -(SizeF left, SizeF right)
Parameters
leftSizeFThe size on the left hand of the operand.
rightSizeFThe size on the right hand of the operand.