LAnnotation::SetRect

#include "ltwrappr.h"

virtual L_INT LAnnotation::SetRect(pRect)

Sets the defining rectangle of the annotation object.

Parameters

pANNRECT 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

Value Meaning
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

Platforms

Win32, x64.

See Also

Functions

Topics

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 ; 
 
   if(AnnRect.right - AnnRect.left > 0 && AnnRect.bottom - AnnRect.top > 0) 
   { 
      nRet = LeadAnn.SetRect(&AnnRect) ; 
      if(nRet != SUCCESS) 
         return nRet; 
      nRet = LeadAnn.SendToBack() ; 
      if(nRet != SUCCESS) 
         return nRet; 
   } 
 
   return SUCCESS; 
} 
Help Version 20.0.2020.4.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help