Gets the parallelogram that contains the specified object(s).
#include "ltwrappr.h"
virtual L_INT LVectorBase::GetObjectParallelogram(pMin, pMax, dwFlags=0)
Pointer to a VECTORPOINT structure to be updated with the minimum point of the bounding parallelogram of the specified object.
Pointer to a VECTORPOINT structure to be updated with the maximum point of the bounding parallelogram of the specified object.
Flag that indicates which parallelogram to use when updating the pMin and pMax parameters. Possible values are:
Value | Meaning |
---|---|
0 | pMin and pMax will be updated with the parallelogram containing all objects within the vector handle. |
VECTOR_FLAGS_SELECTED_ONLY | pMin and pMax will be updated with the parallelogram containing all selected objects within the vector handle. |
VECTOR_FLAGS_TRANSFORMED | Apply current transformation on pMin and pMax before returning. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Obtains the bounding parallelogram of a single object, several selected objects, or all objects within the vector handle.
This example obtains drawing physical extents.
L_INT LVectorBase__GetObjectParallelogramExample(HWND hWnd, LVectorBase *pVector)
{
UNREFERENCED_PARAMETER(hWnd);
L_INT nRet;
VECTORPOINT LeftTop, RightBottom;
POINT LeftTop2D, RightBottom2D;
// Get drawing logical extents
nRet = pVector->GetObjectParallelogram(&LeftTop, &RightBottom);
if(nRet != SUCCESS)
return nRet;
// Convert to physical to get the rect where the drawing will painted
nRet = pVector->LogicalToPhysical(&LeftTop2D, &LeftTop );
if(nRet != SUCCESS)
return nRet;
nRet = pVector->LogicalToPhysical( &RightBottom2D, &RightBottom );
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}