#include "lvkrn.h"
L_LVKRN_API L_INT L_VecGetObjectRect(pVector, pObject, pRect, dwFlags)
Gets the physical bounding rectangle for the specified object(s).
Pointer to a vector handle.
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.
Pointer to a RECT structure to be updated with the bounding rectangle of the specified object(s).
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. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Obtains the physical bounding rectangle of a single object, all selected objects, or all objects within the specified vector handle.
Required DLLs and Libraries
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;
}