Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

AutoBorderDetect setting

Last post 15 Feb 2008, 1:27 AM by andyau. 2 replies.
Sort Posts: Previous Next
  •  31 Jan 2008, 10:37 AM 13067

    AutoBorderDetect setting

    I'm currently using dotTwain to launch my Kodak scanner, but using the following code I'm unable to toggle the Auto Border Removal feature:

    if (_device.QueryCapability(DeviceCapability.ICAP_AUTOMATICBORDERDETECTION, true))
    {
       _device.AutomaticBorderDetection = true;
    }

    If I launch the scanner with _device.HideInterface = false, I'm able to see that the setting the above will execute properly (AutoBorderDetect=true) but it will only 'enable' the border removal drop down box in the driver (preselecting the first 'none' item). If I set the same property to false, the driver's drop down box is disabled. Is there any way to get around this problem so that I can enable the border removal feature in the driver by default?

     

    Cheers

    Andy

  •  01 Feb 2008, 3:34 PM 13084 in reply to 13067

    Re: AutoBorderDetect setting

    The Twain specification states that ICAP_AUTOMATICBORDERDETECTION is a BOOL to turn the feature on/off.  If your scanner requires an additional action then it must be a custom capability.

    DotTwain allows you to get/set custom capabilities using the Device.Controller.GetCapabilityValue and SetCapabilityValue methods.  However, you first would have to figure out what the capability ID is and what the valid values for that capability are.  This means getting a list of all capabilities with Device.GetSupportedCapabilities and looking for any that are returned as numeric values.  Once you have a list of custom capabilities you will need to use Device.Controller.GetCapabilityType and Device.Controller.GetCapabilityArray to get a list of all supported values for each of those custom capabilities.  Then it comes down to trying to set each capability to one of the values returned by GetCapabilityArray and looking at the driver interface to see if it changed the feature you're looking for.

    Something you might try first is to contact Kodak and see if they can tell you what the capability ID and values are, but a reply could take longer than following the steps above.


    Glenn Chittenden Jr.
    Atalasoft Development Team
  •  15 Feb 2008, 1:27 AM 13232 in reply to 13084

    Re: AutoBorderDetect setting

    Wow, thx for the detailed response. I'll have a play around with those methods and see how I go.

     Cheers!

    Andy

View as RSS news feed in XML