Modifies the point pptMove based on the angle from line (pptAnchor, pptMove) and the horizontal.
static L_INT LAnnotation::AdjustPoint (pptAnchor, pptMove, dAngle, nType)
Pointer to an ANNPOINT structure representing the anchor point.
Pointer to an ANNPOINT structure representing the point to be adjusted.
Angle of rotation in radians. Ranges from -Pi to Pi, (-3.1415 - 3.1415) where a positive angle corresponds to clockwise rotation.
Type of adjustment to point. Possible values are:
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
This utility function is used when creating custom annotation objects. It can be used to calculate the horizontal, vertical, or 45 degree component of a rotated annotation object. It can also be used to easily restrict the mouse cursor on rotated annotation objects.
As an example, consider a rectangle that is rotated 35 degrees in the clockwise direction.
The user has clicked on the Anchor point, and moved the mouse to the Move point.
To find the horizontal component of the line that goes from (Anchor, Move), make the following call, and the ptMove point is adjusted to contain only the horizontal component.
The adjusted ptMove can be seen in step 4.
LAnnotation::AdjustPoint(&ptAnchor, &ptMove, 35*PI/180, ANNADJUST_HORIZONTAL)
Conceptually, the following occurs:
Points and rectangle are rotated 35 degrees counter clockwise.
Move point is adjusted to contain only the horizontal component.
Points and rectangle are rotated 35 degrees clockwise to give adjusted Move point.
L_INT LAnnotation_AdjustPointExample(LAnnotation *pObjectChange,
L_DOUBLE dx, dy;
nRet = LAnnotation::AdjustPoint(ptAnchor, ptMove, dAngle, ANNADJUST_HORIZONTAL);
dx = (ptMove->x - ptAnchor->x)/2;
dy = (ptMove->y - ptAnchor->y)/2;
pt = MousePos;
pt.x = (LONG)(ptAnchor->x + dx);
pt.y = (LONG)(ptAnchor->y + dy);
nRet = pObjectChange->Define(&MousePos, ANNDEFINE_APPEND);
if(nRet != SUCCESS)
nRet = pObjectNeighbor->Define(&pt, ANNDEFINE_APPEND);
if(nRet != SUCCESS)
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries