LImageViewer::AnnotationCreatedCallBack

#include "ltwrappr.h"

virtual L_INT LImageViewer::AnnotationCreatedCallBack(nCellIndex, nSubCellIndex, uAnnotationType)

L_INT nCellIndex;

/* index of the affected cell */

L_INT nSubCellIndex;

/* index into the image list attached to the cell */

L_UINT uAnnotationType;

/* annotation type */

This callback function is called every time the user creates on an annotation object.

Parameter

Description

nCellIndex

A zero-based index of the cell that contains the annotation object.

nSubCellIndex

A zero-based index of the sub-cell that contains that annotation object.

uAnnotationType

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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

In order to use this callback function, it must first be set by calling the LImageViewer::EnableAnnotationCreatedCallBack function.

Required DLLs and Libraries

LTIVW

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

See Also

Functions:

LImageViewer::RegionCallBack, LImageViewer::EnableRegionCallBack, LImageViewer::MouseCallBack, LImageViewer::ActionCallBack, LImageViewer::TagCallBack, LImageViewer::EnableTagCallBack, LImageViewer::AnnotationCallBack, LImageViewer::EnableAnnotationCallBack, LImageViewer::EnableAnnotationCreatedCallBack, LImageViewer::PrePaintCallBack, LImageViewer::EnablePrePaintCallBack, LImageViewer::EnablePostPaintCallBack, LImageViewer::PostPaintCallBack, Class Members

Topics:

Image Viewer Cells

 

Image Viewer Functions: Image Viewer Cells

 

Image Viewer Functions: Callbacks

Example

This example converts the annotation object (rectangle, ellipse and hilite) into a region once the user draws them

#ifdef LImageViewerChild 
class LImageViewerChild :public LImageViewer
{
   virtual L_INT AnnotationCreatedCallBack(L_INT    nCellIndex,
                                           L_INT    nSubCellIndex,
                                           L_UINT   uAnnotationType);
};
#endif
L_INT LImageViewerChild::AnnotationCreatedCallBack(L_INT    nCellIndex,
                                L_INT    nSubCellIndex,
                                L_UINT   uAnnotationType)
{
   switch(uAnnotationType)
   {
   case ANNOBJECT_RECT:
   case ANNOBJECT_ELLIPSE:
   case ANNOBJECT_HILITE:
      AnnToRgn( nCellIndex, nSubCellIndex, L_RGN_OR, TRUE, 0);
      break;
   }
   return SUCCESS;
}
L_INT LImageViewer_AnnotationCreatedCallbacksExample(LImageViewer& ImageViewer)
{
   ImageViewer.EnableAnnotationCreatedCallBack(TRUE);
   return SUCCESS;
}