Show / Hide Table of Contents

Struct Size

Size - A value type which defined a size in terms of non-negative width and height

Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace:ImGui
Assembly:ImGui.dll
Syntax
[Serializable]
public struct Size : IFormattable

Constructors

| Improve this Doc

Size(Double, Double)

Constructor which sets the size's initial values. Width and Height must be non-negative

Declaration
public Size(double width, double height)
Parameters
Type Name Description
System.Double width

double - The initial Width

System.Double height

double - THe initial Height

Properties

| Improve this Doc

Empty

Empty - a static property which provides an Empty size. Width and Height are negative-infinity. This is the only situation where size can be negative.

Declaration
public static Size Empty { get; }
Property Value
Type Description
Size
| Improve this Doc

Height

Height - Default is 0, must be non-negative.

Declaration
public double Height { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc

IsEmpty

IsEmpty - this returns true if this size is the Empty size. Note: If size is 0 this Size still contains a 0 or 1 dimensional set of points, so this method should not be used to check for 0 area.

Declaration
public bool IsEmpty { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc

Width

Width - Default is 0, must be non-negative

Declaration
public double Width { get; set; }
Property Value
Type Description
System.Double
| Improve this Doc

Zero

Empty - a static property which provides an Zero size. Width and Height are 0.

Declaration
public static Size Zero { get; }
Property Value
Type Description
Size

Methods

| Improve this Doc

Equals(Size)

Equals - compares this Size with the passed in object. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.

Declaration
public bool Equals(Size value)
Parameters
Type Name Description
Size value

The Size to compare to "this"

Returns
Type Description
System.Boolean

bool - true if "value" is equal to "this".

| Improve this Doc

Equals(Size, Size)

Compares two Size instances for object equality. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.

Declaration
public static bool Equals(Size size1, Size size2)
Parameters
Type Name Description
Size size1

The first Size to compare

Size size2

The second Size to compare

Returns
Type Description
System.Boolean

bool - true if the two Size instances are exactly equal, false otherwise

| Improve this Doc

Equals(Object)

Equals - compares this Size with the passed in object. In this equality double.NaN is equal to itself, unlike in numeric equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail.

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
System.Object o

The object to compare to "this"

Returns
Type Description
System.Boolean

bool - true if the object is an instance of Size and if it's equal to "this".

Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc

GetHashCode()

Returns the HashCode for this Size

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

int - the HashCode for this Size

Overrides
System.ValueType.GetHashCode()
| Improve this Doc

Parse(String)

Parse - returns an instance converted from the provided string using the culture "en-US"

string with Size data
Declaration
public static Size Parse(string source)
Parameters
Type Name Description
System.String source
Returns
Type Description
Size
| Improve this Doc

ToString()

Creates a string representation of this object based on the current culture.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string representation of this object.

Overrides
System.ValueType.ToString()
| Improve this Doc

ToString(IFormatProvider)

Creates a string representation of this object based on the IFormatProvider passed in. If the provider is null, the CurrentCulture is used.

Declaration
public string ToString(IFormatProvider provider)
Parameters
Type Name Description
System.IFormatProvider provider
Returns
Type Description
System.String

A string representation of this object.

Operators

| Improve this Doc

Equality(Size, Size)

Compares two Size instances for exact equality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail. Furthermore, using this equality operator, double.NaN is not equal to itself.

Declaration
public static bool operator ==(Size size1, Size size2)
Parameters
Type Name Description
Size size1

The first Size to compare

Size size2

The second Size to compare

Returns
Type Description
System.Boolean

bool - true if the two Size instances are exactly equal, false otherwise

| Improve this Doc

Explicit(Size to Point)

Explicit conversion to Point

Declaration
public static explicit operator Point(Size size)
Parameters
Type Name Description
Size size

Size - the Size to convert to a Point

Returns
Type Description
Point

Point - A Point equal to this Size

| Improve this Doc

Explicit(Size to Vector)

Explicit conversion to Vector.

Declaration
public static explicit operator Vector(Size size)
Parameters
Type Name Description
Size size

Size - the Size to convert to a Vector

Returns
Type Description
Vector

Vector - A Vector equal to this Size

| Improve this Doc

Inequality(Size, Size)

Compares two Size instances for exact inequality. Note that double values can acquire error when operated upon, such that an exact comparison between two values which are logically equal may fail. Furthermore, using this equality operator, double.NaN is not equal to itself.

Declaration
public static bool operator !=(Size size1, Size size2)
Parameters
Type Name Description
Size size1

The first Size to compare

Size size2

The second Size to compare

Returns
Type Description
System.Boolean

bool - true if the two Size instances are exactly unequal, false otherwise

Explicit Interface Implementations

| Improve this Doc

IFormattable.ToString(String, IFormatProvider)

Creates a string representation of this object based on the format string and IFormatProvider passed in. If the provider is null, the CurrentCulture is used. See the documentation for IFormattable for more information.

Declaration
string IFormattable.ToString(string format, IFormatProvider provider)
Parameters
Type Name Description
System.String format
System.IFormatProvider provider
Returns
Type Description
System.String

A string representation of this object.

Implements
System.IFormattable.ToString(System.String, System.IFormatProvider)
  • Improve this Doc
Back to top Copyright © 2016 zwcloud
Generated by DocFX