To use a custom capability of your TWAIN driver, you need to know what the capability code is first.
You can follow the steps below:
- Install the TWAIN sample application.
Use the TWAIN Sample App to open the source and then check what the hexadecimal value of the capability is.
- As an example, the code 0x8001 is for the highlighted custom capability above. Now we can use the following code to negotiate the capability.
DWObject.SelectSource(); DWObject.OpenSource(); DWObject.Capability = 0x8001; DWObject.CapType = 5; //TWON_ONEVALUE DWObject.CapValue = 1; if (DWObject.CapSet()) alert("successful"); else alert("Source doesn't support this capatiblity");
For more information, please refer to How to Perform Capability Negotiation.