ImageMan ImTwain Control Version 8
NegotiateCapability Method
See Also  Example  Send comments on this topic.
Capability
The Capability to set.
Value
The value the capability should be set to.

Glossary Item Box

Description

The recommended method to use for setting Capabilities.

Syntax

Visual Basic
Public Function NegotiateCapability( _
   ByVal Capability As Long, _
   ByVal Value As Variant _
) As Boolean

Parameters

Capability
The Capability to set.
Value
The value the capability should be set to.

Return Type

Returns True if the Set Capability was successful, otherwise returns false.

Remarks

By using this method you can avoid the hassle of having to call the GetCapability method and then deciphering whether it has returned a Range, Enumeration, or single value. Many devices will ignore incorrect values sent to them, making no rounding or clamping adjustments to them whatsoever. NegotiateCapabilities will adjust the value you are trying to set automatically to comply with the device driver settings.

Does not require the developer to know the datatype of the capability, as with SetCapability, because the method will determine datatype.

The TWAIN specification gives general guidelines for the following capabilities. Use these ranges for your minimum and maximum values and if the scanner returns different minimum and maximum values (either through and enumeration or range object) we will adjust accordingly. For example if you set Brightness to 500 and the scanners minimum brightness is -100 and maximum value is 100 (rather than the standard -1000 to 1000) we will make the necessary compensation and set it to 50. If you set a value that is not one with a recommended range and it is outside of the parameters available it will simply be clamped to the nearest value.

  Values for Capabilities with Recommended Ranges:

Capability

Minimum

Maximum

Alarm_Volume

0

100

Brightness

-1000

1000

Contrast

-1000

1000

Highlight

0

255

Shadow

0

255

Threshold

0

255

Rotation

-360

360

Example

(Visual Basic)Copy Code
' enable the feeder
ImTwain.NegotiateCapability ImTwain80.Capabilities.Feeder_Enabled, True
ImTwain.NegotiateCapability ImTwain80.Capabilities.Auto_Feed, True

See Also

© 2014 Data Techniques Inc. All Rights Reserved.