L_VecGetObjectRect

Summary

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

Syntax

#include "ltvkrn.h"

L_LVKRN_API L_INT L_VecGetObjectRect(pVector, pObject, pRect, dwFlags)

Parameters

const pVECTORHANDLE pVector

Pointer to a vector handle.

const pVECTOROBJECT pObject

Pointer to a VECTOROBJECT structure that references an object. If this parameter is not NULL, the bounding rectangle of this object will be copied into pRect.

If this parameter is NULL, dwFlags will control which objects rectangle to copy into pRect.

L_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 parallelogram to use when updating the pLeftTop and pRightBottom parameters. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:

Value Meaning
0 pLeftTop and pRightBottom will be updated with the parallelogram containing all objects within the vector handle.
VECTOR_FLAGS_SELECTED_ONLY pLeftTop and pRightBottom will be updated with the parallelogram 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

Example

This example will show the physical extent of the selected objects inside the drawing, in a message box.

L_INT VecGetObjectRectExample(pVECTORHANDLE pVector) 
{ 
   L_INT nRet; 
   RECT     rect;             /* Resulting bounding rectangle */ 
   L_TCHAR  szBuffer[ 80 ];   /* Buffer */ 
 
   /* Get the rectangle of selected objects */ 
   nRet = L_VecGetObjectRect( pVector, NULL, &rect, 0L ); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Format into a buffer */ 
   wsprintf( szBuffer, TEXT("%d, %d, %d, %d"), 
             rect.left, rect.top, rect.right, rect.bottom ); 
 
   /* Show in a message box */ 
   MessageBox( NULL, szBuffer, TEXT("Selected Objects Physical Extent"), 0 ); 
 
   return SUCCESS; 
} 

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

LEADTOOLS Vector C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.