Gets the physical bounding rectangle for the specified object(s).
#include "ltwrappr.h"
virtual L_INT LVectorBase::GetObjectRect(pRect, dwFlags=0)
Pointer to a RECT structure to be updated with the bounding rectangle of the specified object(s).
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. |
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.
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;
}