Struct SizeF

Struct SizeF

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging.dll (25.2.0)

Stores an ordered pair of floating-point numbers, typically the width and height of a rectangle.

public struct SizeF

Inherited Members

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

SizeF(SizeF)

Initializes a new instance of the Aspose.Imaging.SizeF structure from the specified Aspose.Imaging.SizeF.

public SizeF(SizeF size)

Parameters

size SizeF

The Aspose.Imaging.SizeF from which to create the new Aspose.Imaging.SizeF.

SizeF(PointF)

Initializes a new instance of the Aspose.Imaging.SizeF structure from the specified Aspose.Imaging.PointF.

public SizeF(PointF point)

Parameters

point PointF

The Aspose.Imaging.PointF from which to initialize this Aspose.Imaging.SizeF.

SizeF(float, float)

Initializes a new instance of the Aspose.Imaging.SizeF structure from the specified dimensions.

public SizeF(float width, float height)

Parameters

width float

The width component of the new Aspose.Imaging.SizeF.

height float

The height component of the new Aspose.Imaging.SizeF.

Properties

Empty

Gets a new instance of the Aspose.Imaging.SizeF structure that has Aspose.Imaging.SizeF.Width and Aspose.Imaging.SizeF.Height values set to zero.

public static SizeF Empty { get; }

Property Value

SizeF

Height

Gets or sets the vertical component of this Aspose.Imaging.SizeF.

public float Height { get; set; }

Property Value

float

IsEmpty

Gets a value indicating whether this Aspose.Imaging.SizeF has zero width and height.

public bool IsEmpty { get; }

Property Value

bool

Width

Gets or sets the horizontal component of this Aspose.Imaging.SizeF.

public float Width { get; set; }

Property Value

float

Methods

Add(SizeF, SizeF)

Adds the width and height of one Aspose.Imaging.SizeF structure to the width and height of another Aspose.Imaging.SizeF structure.

public static SizeF Add(SizeF size1, SizeF size2)

Parameters

size1 SizeF

The first Aspose.Imaging.SizeF to add.

size2 SizeF

The second Aspose.Imaging.SizeF to add.

Returns

SizeF

A Aspose.Imaging.SizeF structure that is the result of the addition operation.

Equals(object)

Tests to see whether the specified object is a Aspose.Imaging.SizeF with the same dimensions as this Aspose.Imaging.SizeF.

public override bool Equals(object obj)

Parameters

obj object

The System.Object to test.

Returns

bool

This method returns true if obj is a Aspose.Imaging.SizeF and has the same width and height as this Aspose.Imaging.SizeF; otherwise, false.

GetHashCode()

Returns a hash code for this Aspose.Imaging.Size structure.

public override int GetHashCode()

Returns

int

An integer value that specifies a hash value for this Aspose.Imaging.Size structure.

Subtract(SizeF, SizeF)

Subtracts the width and height of one Aspose.Imaging.SizeF structure from the width and height of another Aspose.Imaging.SizeF structure.

public static SizeF Subtract(SizeF size1, SizeF size2)

Parameters

size1 SizeF

The Aspose.Imaging.SizeF structure on the left side of the subtraction operator.

size2 SizeF

The Aspose.Imaging.SizeF structure on the right side of the subtraction operator.

Returns

SizeF

The Aspose.Imaging.SizeF that is a result of the subtraction operation.

ToPointF()

Converts a Aspose.Imaging.SizeF to a Aspose.Imaging.PointF.

public PointF ToPointF()

Returns

PointF

Returns a Aspose.Imaging.PointF structure.

ToSize()

Converts a Aspose.Imaging.SizeF to a Aspose.Imaging.Size structure with truncated size values.

public Size ToSize()

Returns

Size

Returns a Aspose.Imaging.Size structure.

ToString()

Creates a human-readable string that represents this Aspose.Imaging.SizeF.

public override string ToString()

Returns

string

A string that represents this Aspose.Imaging.SizeF.

Operators

operator +(SizeF, SizeF)

Adds the width and height of one Aspose.Imaging.SizeF structure to the width and height of another Aspose.Imaging.SizeF structure.

public static SizeF operator +(SizeF size1, SizeF size2)

Parameters

size1 SizeF

The first Aspose.Imaging.SizeF to add.

size2 SizeF

The second Aspose.Imaging.SizeF to add.

Returns

SizeF

A Aspose.Imaging.SizeF structure that is the result of the addition operation.

operator ==(SizeF, SizeF)

Tests whether two Aspose.Imaging.SizeF structures are equal.

public static bool operator ==(SizeF size1, SizeF size2)

Parameters

size1 SizeF

The Aspose.Imaging.SizeF structure on the left side of the equality operator.

size2 SizeF

The Aspose.Imaging.SizeF structure on the right of the equality operator.

Returns

bool

This operator returns true if size1 and size2 have equal width and height; otherwise, false.

explicit operator PointF(SizeF)

Converts the specified Aspose.Imaging.SizeF to a Aspose.Imaging.PointF.

public static explicit operator PointF(SizeF size)

Parameters

size SizeF

The Aspose.Imaging.SizeF structure to be converted

Returns

PointF

The Aspose.Imaging.PointF structure to which this operator converts.

operator !=(SizeF, SizeF)

Tests whether two Aspose.Imaging.SizeF structures are different.

public static bool operator !=(SizeF size1, SizeF size2)

Parameters

size1 SizeF

The Aspose.Imaging.SizeF structure on the left of the inequality operator.

size2 SizeF

The Aspose.Imaging.SizeF structure on the right of the inequality operator.

Returns

bool

This operator returns true if size1 and size2 differ either in width or height; false if size1 and size2 are equal.

operator -(SizeF, SizeF)

Subtracts the width and height of one Aspose.Imaging.SizeF structure from the width and height of another Aspose.Imaging.SizeF structure.

public static SizeF operator -(SizeF size1, SizeF size2)

Parameters

size1 SizeF

The Aspose.Imaging.SizeF on the left side of the subtraction operator.

size2 SizeF

The Aspose.Imaging.SizeF on the right side of the subtraction operator.

Returns

SizeF

A Aspose.Imaging.SizeF that is the result of the subtraction operation.