How to Work with the Containers - MFC
Due to differences in Visual Basic and MFC, LEADTOOLS provides interfaces specifically for working with containers in MFC. These are discussed here.
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 an interface for each container type and the TW_CAPABILITY structure.
The ICapability interface represents the TW_CAPABILITY structure. This interface has two properties that are used in setting and getting the capabilities:
The Capability property contains the capability constant that indicates the specific capability.
ConType 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 ICapabilityOneValue, ICapabilityEnumeration, ICapabilityArray, and ICapabilityRange interfaces. They can be got by calling the QueryInterface method from the ICapability interface.
The ICapabilityOneValue interface represents a container of type TW_ONEVALUE. This interface has the following properties:
The OneValItemType property contains the type of data contained in the ICapabilityOneValue interface).
The OneValCapValue property contains the actual value of the ICapabilityOneValue interface.
The ICapabilityEnumeration interface represents a container of type TW_ENUMERATION. This interface has the following properties:
The EnumItemType property contains the type of data contained in the ICapabilityEnumeration interface.
The EnumCapValue property contains the actual value(s) of the ICapabilityEnumeration interface.
The EnumNumOfItems property contains the number of values in the ICapabilityEnumeration interface.
The EnumCurrentIndex property contains the index of the current value of the ICapabilityEnumeration interface.
The EnumDefaultIndex property contains the index of the default value of the ICapabilityEnumeration interface.
The ICapabilityRange interface represents a container of type TW_RANGE. This interface has the following properties:
The RangeItemType property contains the type of data contained in the ICapabilityRange interface.
The RangeCurrentValue property contains the current value of the ICapabilityRange interface.
The RangeDefaultValue property contains the default value of the ICapabilityRange interface.
The RangeMinimumValue property contains the minimum value in the range of the ICapabilityRange interface.
The RangeMaximumValue property contains the maximum value in the range of the ICapabilityRange interface.
The RangeStepSize property contains the step size in the range of the ICapabilityRange interface.
The ICapabilityArray interface represents a container of type TW_ARRAY. This interface has the following properties:
The ArrayItemType property contains the type of data contained in the ICapabilityArray interface.
The ArrayCapValue property contains the actual value(s) of the ICapabilityArray interface.
The ArrayNumOfItems property contains the number of items in the ICapabilityArray interface.
The ItwFrame interface 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.