#include "ltwrappr.h"

virtual L_INT LAnnotation::GetBoundingRect(pRect, pRectName=NULL)

Gets the bounding rectangle of the annotation object.



Pointer to the RECT structure to be updated with the annotation objects bounding rectangle. Pass NULL if you do not wish to retrieve this information.

LPRECT pRectName

Address of a 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.


Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.


This is the rectangle in which the object is displayed.

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

The defining rectangle intersects the outermost points that define the object. If a line is more than one pixel wide, its defining points are in the middle of the line. Refer to the LAnnotation::GetRect function.

The bounding rectangle accounts for line width and is used as the rectangle to be invalidated when displaying an object. If the line width is an even number, the bounding rectangle is enlarged slightly to allow for variations in how the center of the line is defined on different systems.

Half the width of an object's outer line is outside its defining rectangle.

If the annotation object name is being displayed (see LAnnotation::SetNameOptions and LAnnotation::GetNameOptions for more information on annotation objects 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 the type RECT for the argument pRectName.

Required DLLs and Libraries


Win32, x64.

See Also




L_INT LAnnotation_GetBoundingRectExample(LAnnotation & Annotation) 
   L_INT nRet; 
   RECT rcAnnObjectBounds; 
   RECT rcAnnNameBounds; 
   L_TCHAR szMessage[256]; 
   nRet = Annotation.GetBoundingRect(&rcAnnObjectBounds, &rcAnnNameBounds); 
   if(nRet != SUCCESS) 
      return nRet; 
   wsprintf(szMessage, TEXT("Object Bounds: %d, %d, %d, %d\n  Name Bounds: %d, %d, %d, %d"), 
   MessageBox(NULL, szMessage, TEXT("Testing"), MB_OK); 
   return SUCCESS; 
Help Version 22.0.2021.11.10
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help