﻿Point Structure

# Point Structure

A struct representing X and Y co-ordinates as integer values

Namespace:  Eto.Drawing
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
`public struct Point : IEquatable<Point>`

The Point type exposes the following members.

Constructors
NameDescription
Point(PointF)
Initializes a new instance of a Point class with truncated values of the specified floating-point point
Point(Size)
Initializes a new instance of a Point class with X and Y values corresponding to the Width and Height values of the specified size, respecitively
Point(Int32, Int32)
Initializes a new instance of a Point class with specified x and y values
Top
Properties
NameDescription
IsZero
Gets a value indicating that both the X and Y co-ordinates of this point are zero
Length
Gets the length of the point as a vector from origin 0,0
LengthSquared
Gets the squared length of the point as a vector from origin 0,0.
Normal
Gets the point as a normal vector (perpendicular) to the current point from the origin
UnitVector
Gets the current point as a unit vector (a point with a Length of 1.0 from origin 0,0)
X
Gets or sets the X co-ordinate of this point
Y
Gets or sets the Y co-ordinate of this point
Top
Methods
NameDescription
Abs
Returns the absolute X and Y components of the specified point
Distance(Point)
Gets the distance between this point and the specified point
Distance(Point, Point)
Gets the distance between two points using pythagoras theorem
DotProduct(Point)
Gets the dot product of this instance and the specified point
DotProduct(Point, Point)
Gets the dot product between two points
Equals(Object)
Returns a value indicating that the specified obj is equal to this point
(Overrides ValueTypeEquals(Object).)
Equals(Point)
Returns a value indicating that the specified other point is equal to this point
GetHashCode
Gets the hash code of this point
(Overrides ValueTypeGetHashCode.)
Max
Returns the maximum X and Y components of two points
Min
Returns the minimum X and Y components of two points
Offset(Point)
Offsets the X and Y co-ordinates of this point by the values from the specified point
Offset(Int32, Int32)
Offsets the X and Y co-ordinates of this point by the specified x and y values
Offset(Point, Point)
Offsets the X and Y co-ordinates of the point by the values from the specified offset
Offset(Point, Int32, Int32)
Offsets the X and Y co-ordinates of the point by the specified x and y values
Restrict(Rectangle)
Restricts the X and Y co-ordinates within the specified rectangle
Restrict(Point, Rectangle)
Restricts the X and Y co-ordinates of the specified point within the rectangle
Round
Rounds the X and Y components of the specified point to a Point
ToString
Converts this point to a string
(Overrides ValueTypeToString.)
Truncate
Truncates the X and Y components of the specified point to a Point
UnitVectorAtAngle
Creates a unit vector PointF (a point with a Length of 1.0 from origin 0,0) with the specified angle, in degrees
Top
Operators
NameDescription
Operator to return the addition of two points as a Point
Operator to add a size to a point
Operator to add a value to both the X and Y co-ordinates of a point
Division(Point, Size)
Divides the specified point with a size
Division(Point, Int32)
Divides the X and Y co-ordinates of the specified point with a given value
Equality
Determines equality between two points
(PointF to Point)
Explicit conversion from a PointF to a Point by truncating values
(Size to Point)
Explicit conversion from a size to a Point with a X and Y of the Width and Height values of the size, respectively
Inequality
Determines the inequality between two points
Multiply(Int32, Point)
Multiplies the X and Y co-ordinates of the specified point with a given factor
Multiply(Point, Point)
Multiplies the X and Y co-ordinates of the two specified point values
Multiply(Point, Size)
Multiplies the specified point with a size
Multiply(Point, Int32)
Multiplies the X and Y co-ordinates of the specified point with a given factor
Multiply(Point, Single)
Multiplies the X and Y of a point by the specified floating point factor
Subtraction(Point, Point)
Operator to return the difference between two points as a Size
Subtraction(Point, Size)
Operator to subtract a size from a point
Subtraction(Point, Int32)
Operator to subtract a value from both the X and Y co-ordinates of a point
UnaryNegation
Returns a new Point with negative x and y values of the specified point
Top
Fields
NameDescription
Empty
Gets an empty point with an X and Y value of zero
Top
Remarks
The point struct is used for drawing and positioning of elements and widgets