L_AnnGetRect

Summary

Gets the current defining rectangle of the specified annotation object. Every object has a defining rectangle, which intersects the object's outermost points.

Syntax

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetRect(hObject, pRect, pRectName)

Parameters

HANNOBJECT hObject

Handle to the annotation object.

pANNRECT pRect

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

pANNRECT 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

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

Comments

The defining rectangle, which is used to size and position objects, is different from the bounding 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 defining rectangle for the annotation object name can be obtained by passing the address of a variable of data type RECT for the argument pRectName.

The ANNRECT structure is like a Windows RECT structure, except that it uses double-precision floating point values.

Coordinates of an object's rectangle are relative to its container object. The coordinates are interpreted using the container's scaling factors and offsets, which are described in Low-Level Coordinate System for Annotations.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example gets the defining rectangle for an annotation object, and the defining rectangle for the annotation object's name.

L_INT AnnGetRectExample(HANNOBJECT hObject) 
{ 
   L_INT    nRet; 
   ANNRECT  rcAnnObjectBounds; 
   ANNRECT  rcAnnNameBounds; 
   L_TCHAR  szMsg[200]; 
 
   nRet = L_AnnGetRect(hObject, &rcAnnObjectBounds, &rcAnnNameBounds); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   _stprintf_s(szMsg, TEXT("L_AnnGetRect\n\tObject Bounds[%lf, %lf, %lf, %lf]\n\tName Bounds[%lf,%lf,%lf,%lf]"), 
      rcAnnObjectBounds.left, rcAnnObjectBounds.top, rcAnnObjectBounds.right, rcAnnObjectBounds.bottom, 
      rcAnnNameBounds.left, rcAnnNameBounds.top, rcAnnNameBounds.right, rcAnnNameBounds.bottom); 
 
   _tprintf(_T("%s"), szMsg); 
 
   return SUCCESS; 
} 

Help Version 22.0.2023.7.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.