L_VecGetObjectRect

#include "lvkrn.h"

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

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

const pVECTOROBJECT pObject;

/* pointer to a vector object */

RECT L_FAR *pRect;

/* pointer to a RECT structure */

L_UINT32 dwFlags;

/* flag that indicates which object(s) to use */

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

Parameter

Description

pVector

Pointer to a vector handle.

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 object’s rectangle to copy into pRect.

pRect

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

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

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

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecSelectObject, L_VecIsObjectSelected, L_VecGetObjectParallelogram, L_VecHitTest

Example

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

void ShowSelectedExtent( pVECTORHANDLE pVector )
{
   RECT        rect;             /* Resulting bounding rectangle */
   L_TCHAR      szBuffer[ 80 ];   /* Buffer */

   /* Get the rectangle of selected objects */
   L_VecGetObjectRect( pVector, NULL, &rect, 0L );

   /* 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 );
}