L_AnnSetPoints

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSetPoints(hObject, pPoints, uCount)

HANNOBJECT hObject;

/* handle to the annotation object */

pANNPOINT pPoints;

/* points that specify the shape of the annotation */

L_UINT uCount;

/* number of points */

Defines the shape of an annotation object, such as a polygon, that requires multiple points. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject

Handle to the annotation object.

pPoints

Pointer to the array of LEADTOOLS ANNPOINT structures that specifies the shape of the annotation.

 

The ANNPOINT structure is like a Windows POINT structure, except that it uses double-precision floating point values.

 

Coordinates of an object's points are relative to its container object. The coordinates are interpreted using the container's scaling factors and offsets, which are described in Low-Level Coordinate System for Annotations.

uCount

The number of points in the array that you specify in the pPoints parameter.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

You call this function once, passing an array of points, which must be in the order in which the vertices are connected. To define the line that closes a polygon, the last point in the array is connected to the first point of the array.

Alternatively, you can use the L_AnnDefine function to specify the array of points interactively.

L_AnnSetPoints works only with the following types of objects:

ANNOBJECT_POINTER
ANNOBJECT_FREEHAND
ANNOBJECT_LINE
ANNOBJECT_POLYGON
ANNOBJECT_POLYLINE
ANNOBJECT_POINT
ANNOBJECT_PROTRACTOR
ANNOBJECT_FREEHANDHOTSPOT
ANNOBJECT_TEXTPOINTER
ANNOBJECT_POLYRULER

For annotation objects that are defined by a rectangle, use the L_AnnSetRect function.

You can position a Point object using the following:

ANNPOINT apt;
L_AnnSetPoints(hPoint, apt, 1);

where apt contains the desired position.

To set the points of a cross-product object, do the following:

ANNPOINT apt[5];
L_AnnGetPoints(hPoint, apt, 5);

hPoint is the handle to the cross-product object. apt[0] and apt[1] are the points for the primary ruler. apt[2] is the intersection point. apt[3] and apt[4] are the points for the secondary ruler.

To set the points of a protractor object, do the following:

ANNPOINT apt [3];
L_AnnSetPoints(hPoint, apt, 3);

hPoint is the handle to the protractor object. apt[0] and apt[2] are the endpoints for the two rulers. apt[1] is the intersection point. This is shown below:

image\ProPoint.gif

When calling L_AnnSetPoints on a ANNOBJECT_TEXTPOINTER object, specify three points. The three points are (Upper Left), (Lower Right), (Anchor).

Required DLLs and Libraries

LTANN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 2000 / XP/Vista.

See Also

Functions:

L_AnnBringToFront, L_AnnSendToBack, L_AnnSetRect, L_AnnGetRect, L_AnnGetBoundingRect, L_AnnGetPointCount, L_AnnGetPoints

Topics:

Annotation Functions: Getting and Setting Geometric Properties

 

Annotation Functions: Using Window Coordinates to Define an Object

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Altering Annotation Object Settings

 

Using Rulers in Annotation Objects

 

Annotation Features

 

Calibrating Annotation Ruler Objects

Example

For an example, refer to L_AnnCreate.