L_AnnGetBoundingRect

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetBoundingRect(hObject, pRect, pRectName)

HANNOBJECT hObject;

/* handle to the annotation object */

LPRECT pRect;

/* address of the variable to be updated */

LPRECT pRectName;

/* address of the variable to be updated */

Gets the bounding rectangle of the specified annotation object. This is the rectangle in which the object is displayed.

Parameter

Description

hObject

Handle to the annotation object.

pRect

Address of the variable to be updated with the annotation object's bounding rectangle. Pass NULL if you do not wish to retrieve this information.

pRectName

Address of the variable to be updated with the bounding rectangle of the name of the annotation object. Pass NULL if you do not wish to retrieve this information.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The bounding rectangle is different from the defining rectangle as follows:

Half the width of an object's outer line is outside its defining rectangle, as shown in the following diagram:
image\bndrect.gif

If the annotation object name is being displayed (see L_AnnSetNameOptions and L_AnnGetNameOptions for more information on annotation object names), it can appear far away from the annotation object itself. For this reason, a separate bounding rectangle for the annotation object name can be obtained by passing the address of a variable of data type RECT for the argument pRectName.

Required DLLs and Libraries

LTANN

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

Platforms

Win32, x64.

See Also

Functions:

L_AnnBringToFront, L_AnnSendToBack,

 

L_AnnSetRect, L_AnnGetRect, L_AnnSetPoints, L_AnnGetPointCount, L_AnnGetPoints

Topics:

Annotation Functions: Getting and Setting Geometric Properties

 

Annotation Functions: Using Window Coordinates to Define an Object

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Obtaining Annotation Object Information

Example

This example displays the bounding rectangle for an annotation object, and the bounding rectangle for the annotation object name.

 L_INT AnnGetBoundingRectExample(HANNOBJECT hObject )
{
   L_INT nRet;
   RECT     rcAnnObjectBounds;
   RECT     rcAnnNameBounds;
   L_TCHAR  szMsg[200];

   nRet = L_AnnGetBoundingRect(hObject, &rcAnnObjectBounds, &rcAnnNameBounds);
   if(nRet != SUCCESS)
      return nRet;
   wsprintf(szMsg, TEXT("L_AnnGetBoundingRect\n\tObject Bounds[%d, %d, %d, %d]\n\tName Bounds[%d,%d,%d,%d]"),
      rcAnnObjectBounds.left, rcAnnObjectBounds.top, rcAnnObjectBounds.right, rcAnnObjectBounds.bottom,
      rcAnnNameBounds.left, rcAnnNameBounds.top, rcAnnNameBounds.right, rcAnnNameBounds.bottom);
   MessageBox(NULL, szMsg, TEXT(""), MB_OK);
   return SUCCESS;
}