[]
        
(Showing Draft Content)

GrapeCity.Documents.DX.Point2D

Struct Point2D

Namespace
GrapeCity.Documents.DX
Assembly
GcDocs.DX.Windows.dll

Structure specifing a point with double X and Y coordinates.

public struct Point2D : IEquatable<Point2D>
Implements
System.IEquatable<T><Point2D>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Constructors

Point2D(Point2F)

Initializes a new instance of the Point2D struct.

public Point2D(Point2F p)

Parameters

p Point2F

Point2D(double, double)

Initializes a new instance of the Point2D struct.

public Point2D(double x, double y)

Parameters

x double
y double

Point2D(PointF)

Initializes a new instance of the Point2D struct.

public Point2D(PointF p)

Parameters

p System.Drawing.PointF

Fields

Empty

An empty point.

public static readonly Point2D Empty

Field Value

Point2D

SizeInBytes

The size of the Point2D type, in bytes.

public const int SizeInBytes = 16

Field Value

int

X

The X coordinate of the point.

public double X

Field Value

double

Y

The Y coordinate of the point.

public double Y

Field Value

double

Properties

IsEmpty

Determines if all components of Point2D are equal to zero.

public bool IsEmpty { get; }

Property Value

bool

Methods

Distance(Point2D)

Gets the distance to the given point.

public double Distance(Point2D pt)

Parameters

pt Point2D

Returns

double

DistanceSquared(Point2D)

Gets the square of the distance to the given point.

public double DistanceSquared(Point2D pt)

Parameters

pt Point2D

Returns

double

Equals(Point2D)

Indicates whether this instance and a specified object are equal.

public bool Equals(Point2D other)

Parameters

other Point2D

Returns

bool

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

FromDips(Point2D, float, float)

Converts a point from DIPs to pixels.

public static Point2D FromDips(Point2D pt, float dpiX, float dpiY)

Parameters

pt Point2D
dpiX float
dpiY float

Returns

Point2D

FromDips(float, float)

Converts a point from DIPs to pixels.

public void FromDips(float dpiX, float dpiY)

Parameters

dpiX float
dpiY float

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

Offset(Point2D, Point2D)

Offsets the point by the specified amount.

public static Point2D Offset(Point2D point1, Point2D point2)

Parameters

point1 Point2D
point2 Point2D

Returns

Point2D

Offset(Point2D, Size2D)

Offsets the point by the specified amount.

public static Point2D Offset(Point2D pt, Size2D sz)

Parameters

pt Point2D
sz Size2D

Returns

Point2D

Offset(Point2D, double, double)

Offsets the point by the specified amount.

public static Point2D Offset(Point2D pt, double dx, double dy)

Parameters

pt Point2D
dx double
dy double

Returns

Point2D

Offset(Point2D)

Offsets the point by the specified amount.

public void Offset(Point2D pt)

Parameters

pt Point2D

Offset(Size2D)

Offsets the point by the specified amount.

public void Offset(Size2D sz)

Parameters

sz Size2D

Offset(double, double)

Offsets the point by the specified amount.

public void Offset(double dx, double dy)

Parameters

dx double
dy double

Round()

Returns a Point2L with rounded X and Y coordinates.

public Point2L Round()

Returns

Point2L

Scale(Point2D, double, double)

Scales X and Y coordinates of a point by the specified scaleX and scaleY.

public static Point2D Scale(Point2D pt, double scaleX, double scaleY)

Parameters

pt Point2D
scaleX double
scaleY double

Returns

Point2D

Scale(Point2D, double)

Scales X and Y coordinates of a point by the specified scaleFactor.

public static Point2D Scale(Point2D pt, double scaleFactor)

Parameters

pt Point2D
scaleFactor double

Returns

Point2D

Scale(double, double)

Scales X and Y coordinates of a point by the specified scaleX and scaleY.

public void Scale(double scaleX, double scaleY)

Parameters

scaleX double
scaleY double

Scale(double)

Scales X and Y coordinates of a point by the specified scaleFactor.

public void Scale(double scaleFactor)

Parameters

scaleFactor double

ToDips(Point2D, float, float)

Converts a point from pixels to DIPs.

public static Point2D ToDips(Point2D pt, float dpiX, float dpiY)

Parameters

pt Point2D
dpiX float
dpiY float

Returns

Point2D

ToDips(float, float)

Converts a point from pixels to DIPs.

public void ToDips(float dpiX, float dpiY)

Parameters

dpiX float
dpiY float

ToPoint2F()

Converts Point2D to Point2F.

public Point2F ToPoint2F()

Returns

Point2F

ToPointF()

Converts Point2D to System.Drawing.PointF.

public PointF ToPointF()

Returns

System.Drawing.PointF

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

Truncate()

Returns a Point2L with truncated X and Y coordinates.

public Point2L Truncate()

Returns

Point2L

Operators

operator +(Point2D, Point2D)

Returns the result of addition of point2 to point1.

public static Point2D operator +(Point2D point1, Point2D point2)

Parameters

point1 Point2D
point2 Point2D

Returns

Point2D

operator +(Point2D, Size2D)

Returns the result of addition of size to point.

public static Point2D operator +(Point2D p, Size2D sz)

Parameters

p Point2D
sz Size2D

Returns

Point2D

operator ==(Point2D, Point2D)

Determines if the specified values are equal.

public static bool operator ==(Point2D left, Point2D right)

Parameters

left Point2D
right Point2D

Returns

bool

operator !=(Point2D, Point2D)

Determines if the specified values are not equal.

public static bool operator !=(Point2D left, Point2D right)

Parameters

left Point2D
right Point2D

Returns

bool

operator -(Point2D, Point2D)

Returns the result of substruction of point2 from point1.

public static Point2D operator -(Point2D point1, Point2D point2)

Parameters

point1 Point2D
point2 Point2D

Returns

Point2D

operator -(Point2D, Size2D)

Returns the result of substruction of size from point.

public static Point2D operator -(Point2D point, Size2D sz)

Parameters

point Point2D
sz Size2D

Returns

Point2D