TwainGetCapRangeNumeric Method

See Also     Examples     Applies To

Return the three parameters that define a Range for a TWAIN capability. Many capabilities allow users to select their current value from a range of regularly spaced values. The capability can specify the minimum and maximum acceptable values and the incremental step size between values. For example, resolution might be supported from 100 to 600 in steps of 50 (100, 150, 200, ..., 550, 600).

Syntax

object.TwainGetCapRangeNumeric (nCap, *nMinValue, *nMaxValue, *nStepValue)

The TwainGetCapRangeNumeric syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
nCap Required. Long A TWAIN capability constant.
*nMinValue Required. Double. Output Starting value in the range.
*nMaxValue Required. Double. Final value in the range.
*nStepValue Required. Double. Output Increment from nMinValue to nMaxValue.

Returns

Boolean. True if success, else False -> use TwainGetLastResultCode() and TwainGetLastConditionCode() functions for diagnosing the error.

Remarks

Before using this function check that the TWAIN state is >= 4 (TWAIN_SOURCE_OPEN)
To get the TWAIN state, use the TwainGetState() function.

This fuction can be used to set the folowing types of capabilities: TWTY_INT8, TWTY_INT16, TWTY_INT32, TWTY_UINT8, TWTY_UINT16, TWTY_UINT32, TWTY_BOOL.
You can determine the type of each TWAIN capability using the TwainGetCapItemType function or looking the twain references from http://www.twain.org

Category

TWAIN Functions

Visual Basic Sample

Gets supported Brightness values


Dim bSuccess As Boolean
Dim nMinValue As Double, nMaxValue As Double, nStepValue As Double
Dim nCpt As Long

bSuccess = Object.TwainGetCapRangeNumeric(ICAP_BRIGHTNESS, nMinValue, nMaxValue, nStepValue)
If bSuccess Then
   For nCpt = nMinValue To nMaxValue Step nStepValue
       'Here, you can catch & store the nCpt value somewhere
       MsgBox "A supported value are: " + str(nCpt)
   Next nCpt
End If






© Copyright 2008 GdPicture All rights reserved.
Documentation MAP.