LVectorBase::GetObjectRect

#include "ltwrappr.h"

virtual L_INT LVectorBase::GetObjectRect(pRect, dwFlags=0)

Gets the physical bounding rectangle for the specified object(s).

Parameters

RECT *pRect

Pointer to a RECT structure to be updated with the bounding rectangle of the specified object(s).

L_UINT32 dwFlags

Flag that indicates which rectangle to use when updating the pRect parameter. Possible values are:

Value Meaning
0 pRect will be updated with the rectangle containing all objects within the vector handle.
VECTOR_FLAGS_SELECTED_ONLY pRect will be updated with the rectangle containing all selected objects within the vector handle.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Obtains the physical bounding rectangle of a single object, all selected objects, or all objects within the specified vector handle.

Required DLLs and Libraries

See Also

Functions

Topics

Example

LVectorBase::GetObjectRect() Shows the physical extent of the all objects inside drawing.

L_INT LVectorBase__GetObjectRectExample(HWND hWnd) 
{ 
   L_INT       nRet; 
   RECT        rect; 
   L_TCHAR     szBuffer[100]; 
   LVectorBase Vector; 
 
   nRet = Vector.Load(MAKE_IMAGE_PATH(TEXT("random.dxf"))); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = Vector.AttachToWindow(hWnd); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   GetClientRect(hWnd, &rect); 
 
   nRet = Vector.SetViewport(&rect); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // Get the rectangle of entire object  
   nRet = Vector.GetObjectRect(&rect); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   wsprintf( szBuffer, TEXT("%d, %d, %d, %d"), 
             rect.left, rect.top, rect.right, rect.bottom ); 
 
   MessageBox( NULL, szBuffer, TEXT("Selected Objects Physical Extent"), 0 ); 
 
   return SUCCESS; 
} 

Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C++ Class Library Help