Sets the defining rectangle of the annotation object.
#include "ltwrappr.h"
virtual L_INT LAnnotation::SetRect(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.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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.
Win32, x64.
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 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