LTwain::CreateNumericContainerRange

#include "ltwrappr.h"

virtual L_INT LTwain::CreateNumericContainerRange (pCapability, Type, uMinValue, uMaxValue, uStepSize, uDefaultValue, uCurrentValue)

Allocates the hContainer member of the TW_CAPABILITY structure to be type TW_RANGE and fills it with the appropriate data.

Parameters

TW_CAPABILITY * pCapability

Pointer to a structure that contains the capability container to allocate as type TW_RANGE.

LTWAINNUMERICTYPE Type

Type of data contained in the TW_RANGE container. For a list of possible values, refer to LTWAINNUMERICTYPE.

L_UINT32 uMinValue

The minimum value of the range.

L_UINT32 uMaxValue

The maximum value of the range.

L_UINT32 uStepSize

The step size value of the range.

L_UINT32 uDefaultValue

The default value of the range.

L_UINT32 uCurrentValue

The current value of the range.

Returns

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

Comments

When enumerating and getting capabilities, the toolkit takes care of creating the necessary TW_CAPABILITY containers. However, if the user wants to set a capability using the LTwain::SetCapability function, he or she must declare a TW_CAPABILITY container of the appropriate type (TW_ARRAY, TW_ENUMERATION, TW_RANGE, or TW_ONEVALUE).

The step size is the amount of increase from one step to the next within the range uMinVal to uMaxVal. For example, if uMinValue = 0, uMaxValue = 100, and uStepSize = 2, then it will take 50 steps to increase from 0 to 100.

Required DLLs and Libraries

See Also

Functions

Topics

Example

// initialize session and call this function 
 
L_INT LTwain__CreateNumericContainerRangeExample(LTwain *MyClass) 
 
{ 
   L_INT          nRet; 
   TW_CAPABILITY  twCap;  
 
   memset (&twCap, 0, sizeof(TW_CAPABILITY));  
 
   twCap.Cap = ICAP_XRESOLUTION; 
 
   twCap.ConType = TWON_RANGE; 
 
   nRet = MyClass->CreateNumericContainerRange(&twCap, TWAINNUMERICTYPE_TW_FIX32, 0, 100, 2, 50, 60); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = MyClass->SetCapability(&twCap, LTWAIN_CAPABILITY_SET); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   nRet = MyClass->FreeContainer(&twCap); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS TWAIN C++ Class Library Help