Parameters
Value | Explanation |
---|---|
x,y | The array that holds the retrieved point coordinate
values.
In Visual C++, pass the pointer to the first element in the Array. In Visual Basic, the arguments are given in x(0), Y(0) |
Return Value
Returns True (nonzero) if successful. Returns False (0) if unsuccessful.
Explanation
The GetArrayPointsXY method retrieves the coordinate values for each of the points used to define the selection area drawn using the Select or the FreeSelect tools in the image-editing toolbar.
In the image editing toolbar, the Select tool and the FreeSelect tool can be used to select an area on an image. This selected area is defined by a set of points. In the case of the Select tool, a rectangular selection area is drawn so only 4 points are needed to define that area. In the case of the FreeSelect tool, however, the selection area can be defined by a large number of points. The GetArrayPointsNum method can be used to retrieve the number of points that define the selection area. The GetArrayPointsXY method can be used to retrieve each of the point's X,Y coordinates. The values are in pixels.
For scripting languages and other programs that require variant types, please refer to the GetArrayPointsXYVariant method.
The following sample code for shows how to retrieve the point coordinates in an x,y array.
In Visual Basic
Dim x() As Long
Dim y() As Long
Dim ret As Boolean
Dim count As Long
count = ImageKit1.Edit.GetArrayPointsNum()
If count = 0 Then Exit Sub
ReDim x(0 To count) As Long
ReDim y(0 To count) As Long
ret = ImageKit1.Edit.GetArrayPointsXY(x(0), y(0))
In Visual C++
long *x
long *y;
BOOL ret;
long count;
count = ImageKit1.GetEdit().GetArrayPointsNum();
if (count == 0) return;
x = new long[count];
y = new long[count];
ret = ImageKit1.GetEdit().GetArrayPointsXY(x, y);
// place processing code here
delete[] x;
delete[] y;