Table of Contents

Struct SizeF

Namespace
Aspose.Imaging
Assembly
Aspose.Imaging.dll

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

public struct SizeF
Inherited Members

Constructors

SizeF(PointF)

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

public SizeF(PointF point)

Parameters

point PointF

The PointF from which to initialize this SizeF.

SizeF(SizeF)

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

public SizeF(SizeF size)

Parameters

size SizeF

The SizeF from which to create the new SizeF.

SizeF(float, float)

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

public SizeF(float width, float height)

Parameters

width float

The width component of the new SizeF.

height float

The height component of the new SizeF.

Properties

Empty

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

public static SizeF Empty { get; }

Property Value

SizeF

Height

Gets or sets the vertical component of this SizeF.

public float Height { get; set; }

Property Value

float

The vertical component of this SizeF, typically measured in pixels.

IsEmpty

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

public bool IsEmpty { get; }

Property Value

bool

This property returns true when this SizeF has both a width and height of zero; otherwise, false.

Width

Gets or sets the horizontal component of this SizeF.

public float Width { get; set; }

Property Value

float

The horizontal component of this SizeF, typically measured in pixels.

Methods

Add(SizeF, SizeF)

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

public static SizeF Add(SizeF size1, SizeF size2)

Parameters

size1 SizeF

The first SizeF to add.

size2 SizeF

The second SizeF to add.

Returns

SizeF

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

Equals(object)

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

public override bool Equals(object obj)

Parameters

obj object

The object to test.

Returns

bool

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

GetHashCode()

Returns a hash code for this Size structure.

public override int GetHashCode()

Returns

int

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

Subtract(SizeF, SizeF)

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

public static SizeF Subtract(SizeF size1, SizeF size2)

Parameters

size1 SizeF

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

size2 SizeF

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

Returns

SizeF

The SizeF that is a result of the subtraction operation.

ToPointF()

Converts a SizeF to a PointF.

public PointF ToPointF()

Returns

PointF

Returns a PointF structure.

ToSize()

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

public Size ToSize()

Returns

Size

Returns a Size structure.

ToString()

Creates a human-readable string that represents this SizeF.

public override string ToString()

Returns

string

A string that represents this SizeF.

Operators

operator +(SizeF, SizeF)

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

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

Parameters

size1 SizeF

The first SizeF to add.

size2 SizeF

The second SizeF to add.

Returns

SizeF

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

operator ==(SizeF, SizeF)

Tests whether two SizeF structures are equal.

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

Parameters

size1 SizeF

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

size2 SizeF

The 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 SizeF to a PointF.

public static explicit operator PointF(SizeF size)

Parameters

size SizeF

The SizeF structure to be converted

Returns

PointF

The PointF structure to which this operator converts.

operator !=(SizeF, SizeF)

Tests whether two SizeF structures are different.

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

Parameters

size1 SizeF

The SizeF structure on the left of the inequality operator.

size2 SizeF

The 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 SizeF structure from the width and height of another SizeF structure.

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

Parameters

size1 SizeF

The SizeF on the left side of the subtraction operator.

size2 SizeF

The SizeF on the right side of the subtraction operator.

Returns

SizeF

A SizeF that is the result of the subtraction operation.