Table of Contents

Class DOMPointReadOnly

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The DOMPointReadOnly interface specifies the coordinate and perspective fields used by DOMPoint to define a 2D or 3D point in a coordinate system.

[Value("DOMPointReadOnly")]
public class DOMPointReadOnly
Inheritance
DOMPointReadOnly
Derived
Inherited Members

Remarks

There are two ways to create a new DOMPointReadOnly instance. First, you can use its constructor, passing in the values of the parameters for each dimension and, optionally, the perspective:

The other option is to use the static FromPoint(DOMPointInit) method:

-DOMPoint
-DOMRect
-DOMMatrix

See also on MDN

Constructors

DOMPointReadOnly()

public DOMPointReadOnly()

DOMPointReadOnly(double, double, double, double)

The DOMPointReadOnly()
constructor returns a new DOMPointReadOnly object representing a point
in 2D or 3D space, optionally with perspective, whose values cannot be altered by
script code.

public DOMPointReadOnly(double x = 0, double y = 0, double z = 0, double w = 0)

Parameters

x double
y double
z double
w double

Remarks

Properties

W

The DOMPointReadOnly interface's
w property holds the point's perspective value,
w, for a read-only point in space.

[Value("w")]
public double W { get; }

Property Value

double

A double-precision floating-point value indicating the w perspective value
for the point. This value is unrestricted, meaning that it is allowed
to be infinite or invalid (that is, its value may be GlobalObject.NaN or
GlobalObject.Infinity). The default is 1.0.

Remarks

If your script needs to be able
to change the value of this property, you should instead use the DOMPoint
object.

-The other coordinate properties: X,
Y, and Z.

See also on MDN

X

The DOMPointReadOnly interface's
x property holds the horizontal coordinate, x, for a
read-only point in space. This property cannot be changed by JavaScript code in this
read-only version of the DOMPoint object.

[Value("x")]
public double X { get; }

Property Value

double

A double-precision floating-point value indicating the x coordinate's value for the
point. This value is unrestricted, meaning that it is allowed to be
infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).

Remarks

In general, positive values x mean to the right, and negative values of
x means to the left, assuming no transforms have resulted in a reversal.

-The other coordinate properties: Y,
Z, and the perspective value,
W.

See also on MDN

Y

The DOMPointReadOnly interface's
y property holds the vertical coordinate, y, for a
read-only point in space.

[Value("y")]
public double Y { get; }

Property Value

double

A double-precision floating-point value indicating the y coordinate's value for the
point. This value is unrestricted, meaning that it is allowed to be
infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).

Remarks

If your script needs to be able to change the value
of this property, you should instead use the DOMPoint object.

In general, positive values of y mean downward, and negative values of
y mean upward, assuming no transforms have resulted in a reversal.

-The other coordinate properties: X,
Z, and the perspective value,
W.

See also on MDN

Z

The DOMPointReadOnly interface's
z property holds the depth coordinate, z, for a
read-only point in space.

[Value("z")]
public double Z { get; }

Property Value

double

A double-precision floating-point value indicating the z coordinate's value for the
point. This value is unrestricted, meaning that it is allowed to be
infinite or invalid (that is, its value may be GlobalObject.NaN or GlobalObject.Infinity).

Remarks

If your script needs to be able to change the value
of this property, you should instead use the DOMPoint object.

In general, positive values of z mean toward the user (out from the
screen), and negative values of z mean away from the user (into the
screen), assuming no transforms have resulted in a reversal.

-The other coordinate properties: X,
Y, and the perspective value,
W.

See also on MDN

Methods

FromPoint(DOMPointInit)

The static DOMPointReadOnly
method fromPoint() creates and returns a new
DOMPointReadOnly object given a source point.

[Value("fromPoint")]
public static DOMPointReadOnly FromPoint(DOMPointInit other = null)

Parameters

other DOMPointInit

Returns

DOMPointReadOnly

A new DOMPointReadOnly object (which is identical to the source point).

Remarks

You can also create a new DOMPointReadOnly object using the
DOMPointReadOnly(double, double, double, double) constructor.

See also on MDN

MatrixTransform(DOMMatrixInit)

The matrixTransform() method of the DOMPointReadOnly interface applies a matrix transform specified as an object to the DOMPointReadOnly object, creating and returning a new DOMPointReadOnly object. Neither the matrix nor the point are altered.

[Value("matrixTransform")]
public DOMPoint MatrixTransform(DOMMatrixInit matrix = null)

Parameters

matrix DOMMatrixInit

Returns

DOMPoint

A new DOMPoint object.

Remarks

If the matrix passed as a parameter is 2D (the DOMMatrixReadonly.Is2D is true) then this is a 2D transformation and the point's z coordinate will be 0 and point's w perspective will be 1. Otherwise this is a 3D transformation.

You can also create a new DOMPoint with a point and matrix with the TransformPoint(DOMPointInit) method.

-DOMPoint
-DOMMatrix
-TransformPoint(DOMPointInit)
-CSS transform-function/matrix and transform-function/matrix3d functions

See also on MDN

ToJSON()

The DOMPointReadOnly method
toJSON() returns an object giving the
JSON form of the point object.

[Value("toJSON")]
public Object ToJSON()

Returns

Object

A new object whose properties are set to the values in the
DOMPoint or DOMPointReadOnly on which the method was called.

Remarks