#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnGetBoundingRect(hObject, pRect, pRectName)
Gets the bounding rectangle of the specified annotation object. This is the rectangle in which the object is displayed.
Handle to the annotation object.
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.
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.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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 L_AnnGetRect 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, as shown in the following diagram:
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
Win32, x64.
This example displays the bounding rectangle for an annotation object,
and the bounding rectangle for the annotation object's 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;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document