New to Telerik UI for WinFormsStart a free 30-day trial

SizeF

Struct

Represents a dimension in 2D coordinate space

Definition

Namespace:Telerik.WinForms.Documents.Model

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
[TypeConverter(typeof(SizeFConverter))]
public struct SizeF

Constructors

Initializes a new instance of the SizeF struct.

C#
public SizeF(float width, float height)
Parameters:widthfloat

The width.

heightfloat

The height.

Initializes a new instance of the SizeF struct.

C#
public SizeF(PointF point)
Parameters:pointPointF

The point.

Initializes a new instance of the SizeF struct.

C#
public SizeF(Size size)
Parameters:sizeSize

The size.

Initializes a new instance of the SizeF struct.

C#
public SizeF(SizeF size)
Parameters:sizeSizeF

The size.

Fields

An empty instance.

C#
public static readonly SizeF Empty

Properties

Gets or sets the height.

C#
public float Height { readonly get; set; }
Property Value:

The height.

Gets a value indicating whether this instance is empty.

C#
[Browsable(false)]
public bool IsEmpty { get; }
Property Value:

true if this instance is empty; otherwise, false.

Gets or sets the width.

C#
public float Width { readonly get; set; }
Property Value:

The width.

Methods

Adds the specified size.

C#
public static SizeF Add(SizeF size1, SizeF size2)
Parameters:size1SizeF

The first size.

size2SizeF

The second size.

Returns:

SizeF

Determines whether the specified object, is equal to this instance.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with this instance.

Returns:

bool

true if the specified object is equal to this instance; otherwise, false.

Overrides: ValueType.Equals(object)

Returns a hash code for this instance.

C#
public override int GetHashCode()
Returns:

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Overrides: ValueType.GetHashCode()

Subtracts the specified size.

C#
public static SizeF Subtract(SizeF size1, SizeF size2)
Parameters:size1SizeF

The first size.

size2SizeF

The second size.

Returns:

SizeF

The result of the substraction.

Converts to PointF.

C#
public PointF ToPointF()
Returns:

PointF

The PointF object.

Converts to Size.

C#
public Size ToSize()
Returns:

Size

The Size object.

Converts to string.

C#
public override string ToString()
Returns:

string

A string that represents this instance.

Overrides: ValueType.ToString()

Operators

Performs an explicit conversion from SizeF to PointF.

C#
public static explicit operator PointF(SizeF size)
Parameters:sizeSizeF

The size.

Returns:

PointF

The result of the conversion.

C#
public static implicit operator SizeF(SizeF size)
Parameters:sizeSizeFReturns:

SizeF

Implements the operator -.

C#
public static SizeF operator -(SizeF size1, SizeF size2)
Parameters:size1SizeF

The first size.

size2SizeF

The second size.

Returns:

SizeF

The result of the operator.

Implements the operator !=.

C#
public static bool operator !=(SizeF size1, SizeF size2)
Parameters:size1SizeF

The first size.

size2SizeF

The second size.

Returns:

bool

The result of the operator.

Implements the operator +.

C#
public static SizeF operator +(SizeF size1, SizeF size2)
Parameters:size1SizeF

The first size.

size2SizeF

The second size.

Returns:

SizeF

The result of the operator.

Implements the operator ==.

C#
public static bool operator ==(SizeF size1, SizeF size2)
Parameters:size1SizeF

The first size.

size2SizeF

The second size.

Returns:

bool

The result of the operator.