CoordinateReference Method

NI Vision for Visual Basic

CoordinateReference Method

Syntax

CWIMAQVision.CoordinateReference XPointArray, YPointArray, OriginX, OriginY, AngleDegrees, AngleRadians

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Obsolete—Use BuildCoordinateSystem instead. Builds a reference for any arbitrary coordinate system with respect to the image plane. The reference of the coordinate system is specified as the position of the origin of the coordinate system and the orientation of its x-axis with respect to that of the image plane.

Remarks

XPointArray and YPointArray are arrays of point structures that define the coordinate system. If you specify two points, the method assumes they lie along the x-axis of the coordinate system and uses the first point as the origin of the coordinate axis. If you specify three points, the method assumes the first two points lie along the x-axis, uses the first point as the origin, and assumes the third point is on the y-axis of the coordinate system.

The y-axis of an image is inverted with respect to the cartesian coordinate system.

Parameters

XPointArray As Variant

The x-coordinates of the points used to calculate the coordinate reference.

YPointArray As Variant

The y-coordinates of the points used to calculate the coordinate reference.

OriginX As Long

On return, the x-coordinate of the origin of the new coordinate system.

OriginY As Long

On return, the y-coordinate of the origin of the new coordinate system.

AngleDegrees As Single

On return, the angle, in degrees, of the x-axis of the coordinate system relative to the x-axis of an image.

AngleRadians As Single

On return, the angle, in radians, of the x-axis of the coordinate system relative to the x-axis of an image.

Example

Dim x0, x1, x2, y0, y1, y2
Dim newx As Long
Dim newy As Long
Dim newdegrees As Single
Dim newradians As Single

CWIMAQVision1.CoordinateReference Array(x1, x2, x0), Array(y1, y2, y0), newx, newy, newdegrees, newradians

See Also

BuildCoordinateSystem