#include "ltwrappr.h"

static L_INT LAnnotation::AdjustPoint (pptAnchor, pptMove, dAngle, nType)

pANNPOINT pptAnchor;

pointer to an ANNPOINT structure that contains the anchor point

pANNPOINT pptMove;

pointer to an ANNPOINT structure that contains the point to be adjusted

L_DOUBLE dAngle;

angle of rotation

L_INT nType;

type of adjustment to point

Modifies the point pptMove based on the angle from line (pptAnchor, pptMove) and the horizontal.

Parameter Description
pptAnchor Pointer to an ANNPOINT structure representing the anchor point.
pptMove Pointer to an ANNPOINT structure representing the point to be adjusted.
dAngle Angle of rotation in radians. Ranges from -Pi to Pi, (-3.1415 - 3.1415) where a positive angle corresponds to clockwise rotation.
nType Type of adjustment to point. Possible values are:
  Value Meaning



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:


Initial situation.


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.

Required DLLs and Libraries


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


Win32, x64.

See Also


Class Members, LAnnotation::Define, , LAnnotation::Define2, LAnnContainer::Convert, LAnnotation::GetRestrictToContainer, LAnnEncrypt::GetRotateAngle, LAnnContainer::HitTest, LAnnContainer::RestrictCursor, LAnnotation::SetRestrictToContainer


Implementing Annotations


Automated User Interface for Annotations


Annotation Functions: Creating and Deleting Annotations


Types of Annotations


Annotation Functions: Implementing Custom Annotations


Annotation Functions: Creating Custom Annotations


Annotation Functions: Object Properties


L_INT LAnnotation_AdjustPointExample(LAnnotation *pObjectChange, 
LAnnotation *pObjectNeighbor, 
pANNPOINT ptAnchor, 
pANNPOINT ptMove, 
L_INT dAngle, 
POINT MousePos) 
   L_INT nRet; 
   L_DOUBLE dx, dy; 
   POINT pt; 
   nRet = LAnnotation::AdjustPoint(ptAnchor, ptMove, dAngle, ANNADJUST_HORIZONTAL); 
   if(nRet !=SUCCESS) 
      return nRet; 
   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) 
      return nRet; 
   nRet = pObjectNeighbor->Define(&pt, ANNDEFINE_APPEND); 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS; 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help