Struct Size
Size - A value type which defined a size in terms of non-negative width and height
Inherited Members
Namespace:ImGui
Assembly:ImGui.dll
Syntax
[Serializable]
public struct Size : IFormattable
Constructors
| Improve this DocSize(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 DocEmpty
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 |
Height
Height - Default is 0, must be non-negative.
Declaration
public double Height { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
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 |
Width
Width - Default is 0, must be non-negative
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
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 DocEquals(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". |
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 |
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
GetHashCode()
Returns the HashCode for this Size
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | int - the HashCode for this Size |
Overrides
Parse(String)
Parse - returns an instance converted from the provided string using the culture "en-US"
string with Size dataDeclaration
public static Size Parse(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source |
Returns
Type | Description |
---|---|
Size |
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
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 DocEquality(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 |
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 |
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 |
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 DocIFormattable.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. |