L_ContainerSetScalar

Summary

Sets the container scaling values that will be used to adjust the coordinate values.

Syntax

#include "LtCon.h"

L_LTCON_API L_INT L_ContainerSetScalar(pContainer, pvptScalarNum, pvptScalarDen)

Parameters

pCONTAINERHANDLE pContainer

Pointer to a container handle.

pVECTORPOINT pvptScalarNum

Pointer to a structure of type VECTORPOINT that contains the numerator for scaling the coordinates in the X-, Y-, and Z-directions.

pVECTORPOINT pvptScalarDen

Pointer to structure of type VECTORPOINT that contains the numerator for scaling the coordinates in the X-, Y-, and Z-directions.

Returns

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

Comments

When assigning an external representation to the container, every point (Xa, Ya) in the external representation is transformed by the container to the point (Xc, Yc) by using the following steps:

  1. Add offsets:

       Xb = Xa + nXOffset 

  2. Multiply by scalars:

       Xc = (Xb * nXScalarNum) / nXScalarDen 
       Yc = (Yb * nYScalarNum) / nYScalarDen 

The default offset values are nXOffset=0, nYOffset=0, and nZOffset=0.

The default scalar values are:

ScalarNum.x = 1 
ScalarNum.y = 1 
ScalarNum.z = 1 
ScalarDen.x = 1 
ScalarDen.y = 1 
ScalarDen.z = 1 

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example shows how to set the container coordinates scaling factors.

L_INT ContainerSetScalarExample(pCONTAINERHANDLE pContainer) 
{ 
   L_INT nRet; 
   nRet = L_ContainerIsValid ( pContainer ); 
   if (SUCCESS == nRet ) /* check the validity of container handle */ 
   { 
      VECTORPOINT vptScalarNum, vptScalarDen ; 
 
 
      /* get the current scaling values */ 
      nRet = L_ContainerGetScalar (pContainer, &vptScalarNum, &vptScalarDen ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
      /* Set the horizontal scaling factor */ 
      vptScalarNum.x ++ ;  
      vptScalarDen.x =  1 ; 
 
      /* Set the vertical scaling factor */ 
      vptScalarNum.y ++ ; 
      vptScalarDen.y = 1 ; 
 
      /* Set the z scaling factor to 1:1 factor */ 
      vptScalarNum.z = 1 ; 
      vptScalarDen.z = 1 ; 
 
      nRet = L_ContainerSetScalar (pContainer, &vptScalarNum, &vptScalarDen ) ; 
   } 
   return nRet; 
} 

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

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