LImageViewerCell::AnnotationCreatedCallBack

#include "ltwrappr.h"

virtual L_INT LImageViewerCell::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 LImageViewerCell::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:

LImageViewerCell::RegionCallBack, LImageViewerCell::EnableRegionCallBack, LImageViewerCell::MouseCallBack, LImageViewerCell::ActionCallBack, LImageViewerCell::TagCallBack, LImageViewerCell::EnableTagCallBack, LImageViewerCell::AnnotationCallBack, LImageViewerCell::EnableAnnotationCallBack, LImageViewerCell::EnableAnnotationCreatedCallBack, LImageViewerCell::PrePaintCallBack, LImageViewerCell::EnablePrePaintCallBack, LImageViewerCell::EnablePostPaintCallBack, LImageViewerCell::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

#if defined LTV17_CONFIG
#ifdef LImageViewerChild 
class LImageViewerChild :public LImageViewerCell
{
   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)
{
   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;
}
#else
#ifdef LImageViewerChild 
class LImageViewerChild :public LImageViewerCell
{
   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;
}
#endif // LTV17_CONFIG