L_VecGetObjectAttributes

Summary

Gets the attributes of an object.

Syntax

#include "ltvkrn.h"

L_LVKRN_API L_INT L_VecGetObjectAttributes(pVector, pObject, pnROP, pPen, pBrush, pFont)

Parameters

const pVECTORHANDLE pVector

Pointer to a vector handle.

const pVECTOROBJECT pObject

Pointer to the vector object for which to get the attributes.

L_INT * pnROP

Pointer to a variable to be updated with the object's ROP code. For more information on valid ROP2 codes, refer to your SDK..

pVECTORPEN pPen

Pointer to a VECTORPEN structure to be updated with the characteristics of the pen to use when drawing the class object. If you do not wish to retrieve this information, pass NULL.

pVECTORBRUSH pBrush

Pointer to a VECTORBRUSH structure to be updated with the characteristics of the brush to use when drawing the class object.

pVECTORFONT pFont

Pointer to a VECTORFONT structure to be updated with the characteristics of the font used by the class object.

Returns

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

Comments

If NULL is passed for pnROP, pPen, pBrush and/or pFont, then that parameter will not be updated with the corresponding value. For example, if NULL is passed for the pFont parameter, the pFont parameter will not be updated with the font information for the specified object.

Certain parameters are ignored depending on pObject. For example, if pObject is VECTOR_LINE, then the pBrush and pFont parameters are ignored.

This function provides a simpler way of retrieving object information, without having to get the object descriptor, inspect the object type and then free the descriptor.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will get the line color of the object under a given point regardless of its type.

COLORREF VecGetObjectAttributesExample( 
   pVECTORHANDLE pVector, 
   POINT* pt, 
   L_INT* nRet) 
{ 
   VECTOROBJECT Object; 
   VECTORPEN Pen; 
   COLORREF Color; 
 
   /* hit test */ 
   *nRet = L_VecHitTest( pVector, pt, &Object ); 
   if( *nRet == SUCCESS ) 
   { 
      /* get its PEN */ 
      *nRet = L_VecGetObjectAttributes( pVector, &Object, NULL, &Pen, NULL, NULL ); 
 
      if( Pen.bExtPen ) 
         Color = Pen.NewPen.ExtLogPen.elpColor; 
      else 
         Color = Pen.NewPen.LogPen.lopnColor; 
   } 
   else 
      Color = RGB( 0, 0, 0 );  // no object under color, assume black is default 
 
   return Color; 
} 

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

LEADTOOLS Vector C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.