Click or drag to resize

TwainControllerGetCapabilityArray Method

Retrieves an array of values to the specified capability.

Namespace:  Atalasoft.Twain
Assembly:  Atalasoft.DotTwain (in Atalasoft.DotTwain.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public TwainReturnCode GetCapabilityArray(
	DeviceCapability capability,
	out Object[] array
)

Parameters

capability
Type: Atalasoft.TwainDeviceCapability
The capability to work with.
array
Type: SystemObject
An object that will be set to the resulting array.

Return Value

Type: TwainReturnCode
The return code sent from the driver.
Exceptions
ExceptionCondition
Thrown if a connection to the device is not open.
Remarks
Not all capabilities will return an array of values. Looking at the list of GetSupported* methods in the Device object will provide a list of capabilities that can be used.
Examples
GetCapabilityArrayCS (C#)
object[] items;
TwainReturnCode ret = this.twain.GetCapabilityArray(DeviceCapability.ICAP_PIXELTYPE, out items);
if (ret == TwainReturnCode.TWRC_SUCCESS)
{
    ImagePixelType[] methods = new ImagePixelType[items.Length];
    for (int i = 0; i < items.Length; i++)
        methods[i] = (ImagePixelType)Convert.ToInt32(items[i]);

    return methods;
}
GetCapabilityArrayVB (Visual Basic)
Dim items() As Object
Dim ret As TwainReturnCode =  Me.twain.GetCapabilityArray(DeviceCapability.ICAP_PIXELTYPE, ByRef items) 
If (ret = TwainReturnCode.TWRC_SUCCESS Then
    Dim methods() As ImagePixelType =  New ImagePixelType(items.Length) {} 
        Dim i As Integer
        For  i = 0 To  items.Length- 1  Step  i + 1
            methods(i) = CType(Convert.ToInt32(items(i)), ImagePixelType)
        Next

    Return methods
End If
See Also