LVectorBase::IsObjectInsideRect

#include "ltwrappr.h"

virtual L_INT LVectorBase::IsObjectInsideRect(pRect, bInside, dwFlags=0)

Determines whether the specified object(s) is (are) within the specified rectangle.

Parameters

const RECT *pRect

Pointer to a RECT structure that contains information about a bounding rectangle.

L_BOOL* bInside

Pointer to a variable to be updated with a value that indicates whether the object is inside the specified parallelogram. Possible values are:

Value Meaning
TRUE The specified object(s) is(are) within the specified parallelogram.
FALSE The specified object(s) is(are) not within the specified parallelogram.

L_UINT32 dwFlags

Flag that indicates which object(s) to test. This flag is valid only if pObject is NULL. If pObject is not NULL, this parameter is ignored. Possible values are:

Value Meaning
0 Test all objects in the vector handle to determine whether they are in the specified rectangle.
VECTOR_FLAGS_SELECTED_ONLY Test only the selected objects within the vector handle.

Returns

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

Comments

The rectangle is given in screen (physical) coordinates.

The current view port, pan position, camera, scale, translation and rotation values are all considered when determining whether the object is within the rectangle.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example displays tests if all vector objects are inside a rectangle.

L_INT LVectorBase__IsObjectInsideRectExample(HWND hWnd, LVectorBase *pVector) 
{ 
   UNREFERENCED_PARAMETER(pVector); 
 
   L_INT       nRet; 
   LVectorBase Vector; 
   RECT        rcBounds; 
   L_BOOL      bInside; 
 
   nRet = Vector.Load(MAKE_IMAGE_PATH(TEXT("random.dxf"))); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   //Define a rectangle 
   rcBounds.left   =0; 
   rcBounds.top    =0; 
   rcBounds.right  =50; 
   rcBounds.bottom =50; 
 
   nRet = Vector.IsObjectInsideRect(&rcBounds, &bInside); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   if (bInside) 
      MessageBox(hWnd, TEXT("IsObjectInsideRect() returns TRUE"), TEXT(""), MB_OK); 
   else 
      MessageBox(hWnd, TEXT("IsObjectInsideRect() returns FALSE"), TEXT(""), MB_OK);   
 
   return SUCCESS; 
} 

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

LEADTOOLS Vector C++ Class Library Help