LAnnotation::SetRect

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetRect(pRect)

pANNRECT pRect;

/* pointer to a ANNRECT structure */

Sets the defining rectangle of the annotation object. This function is available in the Document/Medical Toolkits.

Parameter

Description

pRect

Pointer to the ANNRECT structure that specifies the container. 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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

You can use this function to set the dimensions of an annotation object, such as a rectangle or ellipse, that is defined by a rectangle. For polygonal objects, you can use the LAnnPolygon::SetPoints or LAnnPolygon::Define function.

The coordinates of the rectangle 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.

See Also

Functions:

Class Members

Topics:

Annotation Functions: Getting and Setting Geometric Properties

 

Annotation Functions: Using Window Coordinates to Define an Object

 

Displaying and Manipulating Annotation Objects

Example

L_INT LAnnotation_SetRectExample(LAnnotation& LeadAnn) 
{
   L_INT nRet;
   ANNRECT  AnnRect ;
   LeadAnn.BringToFront();
   LeadAnn.GetRect(&AnnRect) ;
   nRet = LeadAnn.Move((AnnRect.right - AnnRect.left) / 20,(AnnRect.bottom - AnnRect.top) / 20, 0); 
   if(nRet != SUCCESS)
      return nRet;
   //...
   //...
   AnnRect.left += 20 ;
   AnnRect.top += 20 ;
   AnnRect.right += 20 ;
   AnnRect.bottom += 20 ;
   nRet = LeadAnn.SetRect(&AnnRect) ;
   if(nRet != SUCCESS)
      return nRet;
   nRet = LeadAnn.SendToBack() ;
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}