DTwainRange::GetExpandedValue

Top  Previous  Next

Syntax

DTwainDoubleRange:

double GetExpandedValue( long n ) const;

 

DTwainLongRange:

long GetExpandedValue( long n ) const;

 

Parameters

n

Position within the range.

 

Return Value

If successful, returns the nth value defined by the range, where n ranges from 0 to DTwainRange::Count( ) - 1 (the maximum number of values defined for the range - 1)   If unsuccessful, either DTwainRange::InvalidDouble is returned for the DTwainDoubleRange type, or DTwainRange::InvalidLong is returned for the DTwainLongRange type.

 

Comments

DTwainRange::GetExpandedValue gets the value within 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 DTwainRange has the following characteristics:

 

minimum = -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 n argument denotes the desired expanded value. In the example above, if the DTwainRange is defined as above (-10 is min., 10 is max., with a step of 2) and n is 3, the -4 would be returned, since it is the fourth value  The DTwainRange::GetExpandedValue function is useful if a certain value within the range is desired without actually expanding the range in memory (the DTwainRange::Expand function returns an expanded DTwainRange).