#include "ltwrappr.h"
virtual L_INT LImageViewerCell::AnnotationCreatedCallBack(nCellIndex, nSubCellIndex, uAnnotationType)
This callback function is called every time the user creates on an annotation object.
A zero-based index of the cell that contains the annotation object.
A zero-based index of the sub-cell that contains that annotation object.
Flag that determines the type of the currently selected annotation object. Possible values are:
| Value | Meaning |
|---|---|
| ANNOBJECT_TEXT | [15] Text annotation object. |
| ANNOBJECT_RECT | [12] Rectangle annotation object. |
| ANNOBJECT_ELLIPSE | [4] Ellipse annotation object. |
| ANNOBJECT_HILITE | [6] Highlight annotation object. |
| ANNOBJECT_PROTRACTOR | [20] Protractor annotation object. |
| ANNOBJECT_RULER | [17] Ruler annotation object. |
| Value | Meaning |
|---|---|
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
In order to use this callback function, it must first be set by calling the LImageViewerCell::EnableAnnotationCreatedCallBack function.
Required DLLs and Libraries
This example converts the annotation object (rectangle, ellipse and hilite) into a region once the user draws them
#ifdef LImageViewerChildclass LImageViewerChild :public LImageViewerCell{virtual L_INT AnnotationCreatedCallBack(L_INT nCellIndex,L_INT nSubCellIndex,L_UINT uAnnotationType);};#endifL_INT LImageViewerChild::AnnotationCreatedCallBack(L_INT nCellIndex,L_INT nSubCellIndex,L_UINT uAnnotationType){UNREFERENCED_PARAMETER(nCellIndex);switch(uAnnotationType){case ANNOBJECT_RECT:case ANNOBJECT_ELLIPSE:case ANNOBJECT_HILITE:AnnToRgn(nSubCellIndex, L_RGN_OR, TRUE, 0);break;}return SUCCESS;}L_INT LImageViewer_AnnotationCreatedCallbacksExample(LImageViewerCell& ImageViewerCell){ImageViewerCell.EnableAnnotationCreatedCallBack(TRUE);return SUCCESS;}