When getting or setting capability information, it may be necessary to create a container for the capability. The structure of the container depends on the type of information in the container. LEADTOOLS supports the following types of TWAIN containers:
TW_ARRAY
TW_ENUMERATION
TW_ONEVALUE
TW_RANGE
For more information on these container types, refer to the TWAIN 1.9 Specification, available at www.twain.org.
The LEADTOOLS TWAIN toolkit provides a class for each container type and the TW_CAPABILITY structure.
The TwainCapabilityBase class represents the TW_CAPABILITY structure. This interface has two properties that are used in setting and getting the capabilities:
The TwainCapabilityBase.Type property contains the capability constant that indicates the specific capability. TwainCapabilityBase.ContainerType property defines the type of the container to use when setting the capability or the container used to get the capability values. The possible container types are defined in the TwainOneValueCapability, TwainEnumerationCapability, TwainArrayCapability, and TwainRangeCapability classes.
The TwainOneValueCapability class represents a container of type TW_ONEVALUE. This interface has the following properties:
The ItemType property contains the type of data contained in the TwainOneValueCapability class. The Value property contains the actual value of the TwainOneValueCapability class.
The TwainEnumerationCapability class represents a container of type TW_ENUMERATION. This interface has the following properties:
The ItemType property contains the type of data contained in the TwainEnumerationCapability class. The GetValue method gets the actual value(s) of the TwainEnumerationCapability class. The SetValue method sets the Enumeration values of the TwainEnumerationCapability class. The Count property contains the number of values in the TTwainEnumerationCapability class. The CurrentIndex property contains the index of the current value of the TwainEnumerationCapability class. The DefaultIndex property contains the index of the default value of the TwainEnumerationCapability class.
The TwainRangeCapability class represents a container of type TW_RANGE. This interface has the following properties:
The ItemType property contains the type of data contained in the TwainRangeCapability class. The CurrentValue property contains the current value of the TwainRangeCapability class. The DefaultValue property contains the default value of the TwainRangeCapability class. The MinimumValue property contains the minimum value in the range of the TwainRangeCapability class. The MaximumValue property contains the maximum value in the range of the TwainRangeCapability class. The StepSize property contains the step size in the range of the TwainRangeCapability class.
The TwainArrayCapability class represents a container of type TW_ARRAY. This interface has the following properties:
The ItemType property contains the type of data contained in the TwainArrayCapability class. The GetValue method gets the actual value(s) of the TwainArrayCapability class. The SetValue method sets the Enumeration values of the TwainArrayCapability class. The Count property contains the number of items in the TwainArrayCapability class.
The TwainFrame class represents a structure of type TW_FRAME. It contains information about the area of the image to acquire. This interface has the following properties:
The RightMargin property contains the right margin value. The LeftMargin property contains the left margin value. The TopMargin property contains the top margin value. The BottomMargin property contains the bottom margin value.