DTWAIN_RangeGetExpValue

Top  Previous  Next

The DTWAIN_RangeGetExpValue function gets the value identified by the DTWAIN_RANGE after Range expansion

 

DTWAIN_BOOL DTWAIN_RangeGetExpValue (

DTWAIN_RANGE

Range,

LONG

WhichValue

LPVOID

lpValue );

 

Parameters

Range

A valid DTWAIN_RANGE type.

 

nWhichValue

Denotes the position in the expanded range

 

lpValue

Address where to store expanded value

 

 

Return Values

If the function succeeds, TRUE is returned.  If the function fails FALSE is returned.

 

Comments

The DTWAIN_RangeGetExpValue function gets a value from an expanded range.

 

Range expansion is the act of taking a range and generating all of the numbers that the range defines.  The minimum, maximum, and step sizes determine the expanded numbers. For example if the DTWAIN_RANGE has the following characteristics:

 

Minimum Value = -10

Maximum Value = 10

Step size = 2

 

The expanded range will consist of the following values

 

-10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10

 

The nWhichValue denotes the desired expanded value.  The nWhichValue can range from zero (0) to the total number of values in the expanded range minus one.  In the example above, if the DTWAIN_RANGE is defined as above (-10 is min., 10 is max., with a step of 2) and nWhichValue is 3, the -4 would be returned, since it is the fourth value (remember that nWhichValue is zero-based, so the value of 3 denotes the fourth position).

 

The DTWAIN_RangeGetExpValue function is very useful if a certain value within the range is desired without actually expanding the range in memory (the DTWAIN_RangeExpand function actually returns an expanded DTWAIN_RANGE).

 

TWAIN State Transitions

None.

 

Prerequisite Function Call(s)

DTWAIN_SysInitialize

 

See Also

DTWAIN Range Functions