L_AnnGetRect

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetRect(hObject, pRect, pRectNamet)

HANNOBJECT hObject;

/* handle to the annotation object */

pANNRECT pRect;

/* address of the variable to be updated */

pANNRECT pRectName;

/* address of the variable to be updated */

Gets the current defining rectangle of the specified annotation object. Every object has a defining rectangle, which intersects the object's outermost points. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject

Handle to the annotation object.

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.

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 defining rectangle, which is used to size and position objects, is different from the bounding rectangle as follows:

image\sqrblit.gif 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.

image\sqrblit.gif 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. Refer to the L_AnnGetBoundingRect function.

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

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

Windows 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AnnBringToFront, L_AnnSendToBack, L_AnnSetRect, L_AnnSetPoints, L_AnnGetBoundingRect, L_AnnGetPointCount, L_AnnGetPoints

Topics:

Annotation Functions: Getting and Setting Geometric Properties

 

Annotation Functions: Using Window Coordinates to Define an Object

 

Implementing a Non-Automated Annotation Program

 

Obtaining Annotation Object Information

Example

//This example displays the defining rectangle for an annotation object,
//and the defining rectangle for the annotation object name
void SampleAnnGetDefiningRect(HANNOBJECT hObject )
{
   ANNRECT rcAnnObjectBounds;
   ANNRECT rcAnnNameBounds;
   L_TCHAR szMsg[200];

   L_AnnGetRect(hObject, &rcAnnObjectBounds, &rcAnnNameBounds);
   wsprintf(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);
   MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}