Constructors
Initializes a new SizeF class with an identical width and height
Parameters:
| size (float) | Initial width and height of the size |
Fields
Properties
Methods
Abs
#Returns the absolute width and height of the specified
sizeParameters:
| size (SizeF) | Size to convert |
Returns: A new instance of a Size struct with absolute (positive) width and height
Contains
#Gets a value indicating that the specified
x and y values are within the Width and Height of this sizeReturns: True if the
x and y values are between 0 and the Width and Height of this size, respectively. False otherwiseContains
#Parameters:
| point (PointF) | Point to test |
Returns: True if the
point has an X and Y value between 0 and the Width and Height of this size, respectively. False otherwiseEquals
#Compares this size to the specified
objParameters:
| obj (object) | Object to compare with |
Returns: True if the specified
obj is a Size and is equal to this instanceOverrides: ValueType.Equals
Equals
#Compares this size to the
other sizeParameters:
| other (SizeF) | Other size to compare with |
Returns: True if the
other size is equal to this instanceFitTo
#Fits this size to the specified
constraint, keeping the aspectParameters:
| constraint (SizeF) | Constraint to fit the new size into |
Returns: The new size with the same aspect ratio with the width/height equal or within the constraint
GetHashCode
#Gets the hash code for this Size
Returns: Hash code value for this size
Overrides: ValueType.GetHashCode
Max
#Returns the maximum width and height of two sizes
Min
#Returns the minimum width and height of two sizes
ToString
#Converts this Size struct to a string
Returns: String representation of this SizeF
Overrides: ValueType.ToString
Operators
| Operation | Result | Description | ||
|---|---|---|---|---|
| SizeF | + | float | SizeF | Adds a value to the Width and Height of the specified size |
| SizeF | + | SizeF | SizeF | Adds the Width and Height values of two sizes together |
| SizeF | / | float | SizeF | Divides the Width and Height of a size by the specified factor |
| SizeF | / | SizeF | SizeF | Divides the Width and Height of two sizes |
| SizeF | == | SizeF | bool | Compares two sizes for equality |
| SizeF | != | SizeF | bool | Compares two sizes for inequality |
| float | * | SizeF | SizeF | Multiplies the Width and Height of a size by the specified factor |
| SizeF | * | float | SizeF | Multiplies the Width and Height of a size by the specified factor |
| SizeF | * | SizeF | SizeF | Multiplies the Width and Height of two sizes |
| SizeF | - | float | SizeF | Subtracts a value from the Width and Height of the specified size |
| SizeF | - | SizeF | SizeF | Subtracts the Width and Height value of one size from another |
| - | SizeF | SizeF | Negates the Width and Height of the specified size value | |