Class SizeF
Stores an ordered pair of single precision floating points, which specify a height and width.
Inheritance
Implements
Namespace: IronSoftware.Drawing
Assembly: IronSoftware.Drawing.Common.dll
Syntax
public sealed class SizeF : ValueType, IEquatable<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
SizeF(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 |
|---|---|---|
| System.Single | width | The width of the size. |
| System.Single | height | The height of the size. |
Fields
Empty
Represents a SizeF that has Width and Height values set to zero.
Declaration
public static readonly SizeF Empty
Field Value
| Type | Description |
|---|---|
| SizeF |
Properties
Height
Gets or sets the height of this SizeF.
Declaration
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Width
Gets or sets the width of this SizeF.
Declaration
public float Width { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Methods
Add(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 |
|---|---|---|
| System.Single | width | The out value for the width. |
| System.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 |
|---|---|
| System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
Returns
| Type | Description |
|---|---|
| System.Boolean |
GetHashCode()
Calculate a hash code.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.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 |
|---|---|
| System.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. |
| System.Numerics.Matrix3x2 | matrix | The transformation matrix. |
Returns
| Type | Description |
|---|---|
| SizeF | A transformed size. |
Operators
Addition(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. |
| System.Single | right | Divisor of type System.Int32. |
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 |
|---|---|
| System.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 SizeF)
Convert to a Microsoft.Maui.Graphics.SizeF type.
Declaration
public static implicit operator SizeF(SizeF v)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeF | v |
Returns
| Type | Description |
|---|---|
| Microsoft.Maui.Graphics.SizeF |
Implicit(SizeF to SizeF)
Convert to a SixLabors.ImageSharp.SizeF type.
Declaration
public static implicit operator SizeF(SizeF v)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeF | v |
Returns
| Type | Description |
|---|---|
| SixLabors.ImageSharp.SizeF |
Implicit(SizeF to SKSize)
Convert to a SkiaSharp.SKSize type.
Declaration
public static implicit operator SKSize(SizeF v)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeF | v |
Returns
| Type | Description |
|---|---|
| SkiaSharp.SKSize |
Implicit(SizeF to SizeF)
Convert to a System.Drawing.Size type.
Declaration
public static implicit operator SizeF(SizeF v)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeF | v |
Returns
| Type | Description |
|---|---|
| System.Drawing.SizeF |
Implicit(SizeF to Vector2)
Creates a System.Numerics.Vector2 with the coordinates of the specified PointF.
Declaration
public static implicit operator Vector2(SizeF point)
Parameters
| Type | Name | Description |
|---|---|---|
| SizeF | point | The point. |
Returns
| Type | Description |
|---|---|
| System.Numerics.Vector2 | The System.Numerics.Vector2. |
Implicit(SizeF to SizeF)
Convert a Microsoft.Maui.Graphics.SizeF type to a SizeF type.
Declaration
public static implicit operator SizeF(SizeF v)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Maui.Graphics.SizeF | v |
Returns
| Type | Description |
|---|---|
| SizeF |
Implicit(SizeF to SizeF)
Convert a System.Drawing.SizeF type to a SizeF type.
Declaration
public static implicit operator SizeF(SizeF v)
Parameters
| Type | Name | Description |
|---|---|---|
| SixLabors.ImageSharp.SizeF | v |
Returns
| Type | Description |
|---|---|
| SizeF |
Implicit(SKSize to SizeF)
Convert a SkiaSharp.SKSize type to a SizeF type.
Declaration
public static implicit operator SizeF(SKSize v)
Parameters
| Type | Name | Description |
|---|---|---|
| SkiaSharp.SKSize | v |
Returns
| Type | Description |
|---|---|
| SizeF |
Implicit(SizeF to SizeF)
Convert a System.Drawing.SizeF type to a SizeF type.
Declaration
public static implicit operator SizeF(SizeF v)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.SizeF | v |
Returns
| Type | Description |
|---|---|
| SizeF |
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 |
|---|---|
| System.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. |
| System.Single | right | Multiplier of type System.Single. |
Returns
| Type | Description |
|---|---|
| SizeF | Product of type SizeF. |
Multiply(Single, SizeF)
Declaration
public static SizeF operator *(float left, SizeF right)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Single | left | Multiplier of type System.Single. |
| 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. |