Click or drag to resize

Size Structure

Represents a size with width and height components

Namespace:  Eto.Drawing
Assembly:  Eto (in Eto.dll) Version: 2.4.0
Syntax
[TypeConverterAttribute(typeof(SizeConverter))]
public struct Size : IEquatable<Size>

The Size type exposes the following members.

Constructors
  NameDescription
Public methodSize(Point)
Initializes a new Size class with width and height corresponding to the X and Y of the specified point
Public methodSize(SizeF)
Initializes a new Size with the truncated width and height of size.
Public methodSize(Int32, Int32)
Initializes a new Size class with the specified width and height
Top
Properties
  NameDescription
Public propertyHeight
Gets or sets the height
Public propertyIsEmpty
Gets a value indicating that either the Width or Height are zero
Public propertyIsZero
Gets a value indicating that both the Width and Height are zero
Public propertyWidth
Gets or sets the width
Top
Methods
  NameDescription
Public methodStatic memberAbs
Returns the absolute width and height of the specified size
Public methodStatic memberCeiling
Converts a floating point size to an integral size by rounding the width and height to the next integral value.
Public methodContains(Point)
Gets a value indicating that the specified point is within the Width and Height of this size
Public methodContains(Int32, Int32)
Gets a value indicating that the specified x and y values are within the Width and Height of this size
Public methodEquals(Object)
Compares this size to the specified obj
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Size)
Compares this size to the other size
Public methodFitTo
Fits this size to the specified constraint, keeping the aspect
Public methodGetHashCode
Gets the hash code for this Size
(Overrides ValueTypeGetHashCode.)
Public methodStatic memberMax
Returns the maximum width and height of two sizes
Public methodStatic memberMin
Returns the minimum width and height of two sizes
Public methodStatic memberRound
Converts a floating point size to an integral size by rounding the width and height
Public methodToString
Converts this Size struct to a string
(Overrides ValueTypeToString.)
Public methodStatic memberTruncate
Converts a floating point size to an integral size by truncating the width and height
Top
Operators
  NameDescription
Public operatorStatic memberAddition(Size, Point)
Adds the X and Y value to the Width and Height of a size
Public operatorStatic memberAddition(Size, Size)
Adds the Width and Height values of two sizes together
Public operatorStatic memberAddition(Size, Int32)
Adds a value to the Width and Height of the specified size
Public operatorStatic memberDivision(Size, Size)
Divides the Width and Height of two sizes
Public operatorStatic memberDivision(Size, Int32)
Divides the Width and Height of a size by the specified factor
Public operatorStatic memberEquality
Compares two sizes for equality
Public operatorStatic member(Point to Size)
Explicit conversion from a point to a Size with a Width and Height of the X and Y values of the point, respectively
Public operatorStatic member(SizeF to Size)
Explicit conversion from a SizeF to a Size by truncating values
Public operatorStatic memberInequality
Compares two sizes for inequality
Public operatorStatic memberMultiply(Int32, Size)
Multiplies the Width and Height of a size by the specified factor
Public operatorStatic memberMultiply(Size, Size)
Multiplies the Width and Height of two sizes
Public operatorStatic memberMultiply(Size, Int32)
Multiplies the Width and Height of a size by the specified factor
Public operatorStatic memberMultiply(Size, Single)
Multiplies the Width and Height of a size by the specified floating point factor
Public operatorStatic memberSubtraction(Size, Point)
Subtracts the X and Y value from the Width and Height of a size
Public operatorStatic memberSubtraction(Size, Size)
Subtracts the Width and Height value of one size from another
Public operatorStatic memberSubtraction(Size, Int32)
Subtracts a value from the Width and Height of the specified size
Public operatorStatic memberUnaryNegation
Negates the Width and Height of the specified size value
Top
Fields
  NameDescription
Public fieldStatic memberEmpty
Gets an empty size with a zero width and height
Public fieldStatic memberMaxValue
Size with width and height with a maximum int value
Public fieldStatic memberMinValue
Size with width and height with a minimum int value
Top
See Also