The LEADTOOLS C++ Class Library is a wrapper to the LEADTOOLS C API and provides only a subset of the features and functionality otherwise available in the LEADTOOLS C API. For more information about the full feature set of the LEADTOOLS C API, refer to LEADTOOLS C API Introduction.
Is this page helpful?
✎ NOTE
THIS FUNCTION IS NOW INHERITED DIRECTLY FROM THE PARENT LANNOTATION CLASS.
Specifies the shape when creating or transforming an annotation object. This function specifies one point in the current window each time it is called.
#include "ltwrappr.h"
virtual L_INT LAnnFreehand::Define(pPoint, uState)
Pointer to a POINT structure. The points in the array 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. To define a rectangle, the last point is the opposite vertex of the first point.
State of the process of modifying the annotation object.
Value | Meaning |
---|---|
ANNDEFINE_BEGINSET | [0] This is the first point to define a new object. |
ANNDEFINE_BEGINMOVE | [1] This is the point from which to move the object. |
ANNDEFINE_BEGINROTATE | [2] This is the starting point for calculating the angle of rotation. |
ANNDEFINE_BEGINRESIZE | [3] This is the starting point for calculating the how to resize the object. |
ANNDEFINE_BEGINSELECT | [4] This is the first corner of the rectangle used to select objects. |
ANNDEFINE_APPEND | [5] This is the next point when defining an object that requires more than two points. |
ANNDEFINE_UPDATE | [6] This is the current mouse position during creation of the object. Use this on a mouse move event to reflect the current shape of the object. |
ANNDEFINE_END | [7] This is the last point. |
ANNDEFINE_BEGINMOVESELECTED | [8] This is the point from which to move all selected objects. |
ANNDEFINE_BEGINROTATESELECTED | [9] This is the starting point for calculating the angle of rotation for all selected objects. |
ANNDEFINE_BEGINRESIZESELECTED | [10] This is the starting point for calculating the how to resize all selected objects. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Before calling this function, you must create the object, and the object must have a window handle (which can be inherited from the container).
To specify the shape of an object that is defined by a polygon, you call this function repeatedly to create 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.
You can also call this function on mouse move events during the definition of an object to update the current view of the object being defined. Thus, this function can handle the display of the object during and after its creation.
When rotating or resizing an object, you call this function for the first point and last point, and this function determines the angle of rotation or resize parameters based on the difference in the points.
Win32, x64.
L_INT LAnnFreehand_DefineExample(LAnnFreehand * pAnnObject,HWND hWnd)
{
L_INT nRet = SUCCESS;
RECT rClientRect;
POINT MyPoint;
GetClientRect(hWnd,&rClientRect) ;
// Set the point for the opposite corner of the rectangle
MyPoint.x = rClientRect.right / 2;
MyPoint.y = rClientRect.bottom / 2;
// Finish defining the rectangular annotation object
nRet = pAnnObject->Define( &MyPoint, ANNDEFINE_END);
return nRet;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document