You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > TWAIN Features > TwainGetCapRangeNumeric Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.TwainGetCapRangeNumeric Method

Returns 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).

C#
public Boolean TwainGetCapRangeNumeric(
    TwainCapabilities Cap, 
    ref Double nMinValue, 
    ref Double nMaxValue, 
    ref Double nStepValue
);
Visual Basic
Public Function TwainGetCapRangeNumeric(
    ByVal Cap As TwainCapabilities, 
    ByRef nMinValue As Double, 
    ByRef nMaxValue As Double, 
    ByRef nStepValue As Double
) As Boolean
Parameters
Parameters 
Description 
Cap 
A member of the TwainCapabilities enumeration.  
nMinValue 
Output parameter. Starting value in the range.  
nMaxValue 
Output parameter. Final value in the range.  
nStepValue 
Output parameter. Increment from nMinValue to nMaxValue.  
Returns

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

Before using this function check that the TWAIN state is >= 4 (TWAIN_SOURCE_OPEN) 

To get the TWAIN state, use the TwainGetState() function. 

 

This function can be used to set the following types of capabilities: TWTY_INT8 , TWTY_INT16, TWTY_INT32, TWTY_UINT8, TWTY_UINT16, TWTY_UINT32, TWTY_BOOL, TWTY_FIX32, TWTY_FRAME. 

You can determine the type of each TWAIN capability using the TwainGetCapItemType function or looking the twain references from http://www.twain.org

Gets supported Brightness values

Dim bSuccess As Boolean
Dim MinValue As Double, MaxValue As Double, StepValue As Double
Dim i As Integer
 
oGdPictureImaging.TwainOpenDefaultSource(Me.Handle)
bSuccess = oGdPictureImaging.TwainGetCapRangeNumeric(TwainCapabilities.ICAP_BRIGHTNESS, MinValue, MaxValue, StepValue)
If bSuccess Then
    For i = CInt(MinValue) To CInt(MaxValue) Step CInt(StepValue)
'Here, you can catch & store the i value somewhere
MsgBox("A supported value is: " + Str(i))
    Next i
End If
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.