Table of Contents

Struct Point

Namespace
Aspose.Imaging
Assembly
Aspose.Imaging.dll

Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane.

public struct Point
Inherited Members

Constructors

Point(Size)

Initializes a new instance of the Point structure from the Size structure.

public Point(Size size)

Parameters

size Size

Contains the new point coordinates.

Point(int)

Initializes a new instance of the Point structure using coordinates specified by an integer value.

public Point(int dw)

Parameters

dw int

A 32-bit integer that specifies the coordinates for the new point.

Point(int, int)

Initializes a new instance of the Point structure with the specified coordinates.

public Point(int x, int y)

Parameters

x int

The horizontal position of the point.

y int

The vertical position of the point.

Properties

Empty

Gets a new instance of the Point structure that has X and Y values set to zero.

public static Point Empty { get; }

Property Value

Point

IsEmpty

Gets a value indicating whether this Point is empty.

public bool IsEmpty { get; }

Property Value

bool

True if both X and Y are 0; otherwise, false.

X

Gets or sets the x-coordinate of this Point.

public int X { get; set; }

Property Value

int

Y

Gets or sets the y-coordinate of this Point.

public int Y { get; set; }

Property Value

int

Methods

Add(Point, Size)

Adds the specified Size to the specified Point.

public static Point Add(Point point, Size size)

Parameters

point Point

The Point to add to.

size Size

The Size to add to the point.

Returns

Point

The Point that is the result of the addition operation.

Ceiling(PointF)

Converts the specified PointF to a Point by rounding the values of the PointF to the next higher integer values.

public static Point Ceiling(PointF point)

Parameters

point PointF

The PointF to convert.

Returns

Point

The Point this method converts to.

Equals(object)

Specifies whether this Point contains the same coordinates as the specified object.

public override bool Equals(object obj)

Parameters

obj object

The object to test.

Returns

bool

True if obj is a Point and has the same coordinates as this Point.

FromLong(long, out int, out int)

Deconstruct a Point object packed into a long object to separate X and Y int values.

public static void FromLong(long packedPoint, out int x, out int y)

Parameters

packedPoint long

The Point object packed into one long value.

x int

The extracted from the packed Point X value.

y int

The extracted from the packed Point Y value.

GetHashCode()

Returns a hash code for this Point.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Offset(Point)

Translates this Point by the specified Point.

public void Offset(Point point)

Parameters

point Point

The Point used to offset this Point.

Offset(int, int)

Translates this Point by the specified amount.

public void Offset(int dx, int dy)

Parameters

dx int

The amount to offset the x-coordinate.

dy int

The amount to offset the y-coordinate.

Round(PointF)

Converts the specified PointF to a Point object by rounding the Point values to the nearest integer.

public static Point Round(PointF point)

Parameters

point PointF

The PointF to convert.

Returns

Point

The Point this method converts to.

Subtract(Point, Size)

Returns the result of subtracting specified Size from the specified Point.

public static Point Subtract(Point point, Size size)

Parameters

point Point

The Point to be subtracted from.

size Size

The Size to subtract from the point.

Returns

Point

The Point that is the result of the subtraction operation.

ToLong()

Convert this Point to a single long value, containing X and Y coordinates in high and low bits.

public long ToLong()

Returns

long

The Point object packed into one long value.

ToString()

Converts this Point to a human-readable string.

public override string ToString()

Returns

string

A string that represents this instance.

Truncate(PointF)

Converts the specified PointF to a Point by truncating the values of the Point.

public static Point Truncate(PointF point)

Parameters

point PointF

The PointF to convert.

Returns

Point

The Point this method converts to.

Operators

operator +(Point, Size)

Translates a Point by a given Size.

public static Point operator +(Point point, Size size)

Parameters

point Point

The Point to translate.

size Size

A Size that specifies the pair of numbers to add to the coordinates of point.

Returns

Point

The translated Point.

operator ==(Point, Point)

Compares two Point objects. The result specifies whether the values of the X and Y properties of the two Point objects are equal.

public static bool operator ==(Point point1, Point point2)

Parameters

point1 Point

A first Point to compare.

point2 Point

A second Point to compare.

Returns

bool

True if the X and Y values of point1 and point2 are equal; otherwise, false.

explicit operator Size(Point)

Converts the specified Point structure to a Size structure.

public static explicit operator Size(Point point)

Parameters

point Point

The Point to be converted.

Returns

Size

The Size that results from the conversion.

implicit operator PointF(Point)

Converts the specified Point structure to the PointF structure.

public static implicit operator PointF(Point point)

Parameters

point Point

The Point to be converted.

Returns

PointF

The PointF that results from the conversion.

operator !=(Point, Point)

Compares two Point objects. The result specifies whether the values of the X or Y properties of the two Point objects are unequal.

public static bool operator !=(Point point1, Point point2)

Parameters

point1 Point

A first Point to compare.

point2 Point

A second Point to compare.

Returns

bool

True if the values of either the X properties or the Y properties of point1 and point2 differ; otherwise, false.

operator -(Point, Size)

Translates a Point by the negative of a given Size.

public static Point operator -(Point point, Size size)

Parameters

point Point

The Point to translate.

size Size

A Size that specifies the pair of numbers to subtract from the coordinates of point.

Returns

Point

A Point structure that is translated by the negative of a given Size structure.