Page 1 of 1

Color Dropout

Posted: Thu May 31, 2012 4:02 pm
by Krishna
Hi,

According to Twain specifications, ICAP_FILTER can be used to dropout certain colors. But VSTwain DeviceCapability doesnt seem to support this particular Capability. Is there any way I can dropout colors(green in my case) using VSTwain? ( we only purchased the VintaSoftTwain.net SDK and not the imaging one).

Thanks,
Krishna

Re: Color Dropout

Posted: Sat Jun 02, 2012 9:53 am
by Alex
Hello Krishna,

First, you need check that ICAP_FILTER capability is supported by your scanner:

Code: Select all

DeviceCapability filterCap = device.Capabilities.Find(DeviceCapabilityId.IFilter);
if (filterCap == null)
    throw new ApplicationException("ICAP_FILTER capability is not supported by device.");
Next, you need get supported values of capability:

Code: Select all

DeviceCapabilityValueBase filterCapValue = filterCap.GetValue();
switch (filterCapValue.ContainerType)
{
    case DeviceCapabilityContainerType.Array:
        ArrayDeviceCapabilityValue filterCapValueAsArray = (ArrayDeviceCapabilityValue)filterCapValue;
        // get supported values of capability
        ...
        break;

    case DeviceCapabilityContainerType.Enum:
        EnumDeviceCapabilityValue filterCapValueAsEnum = (EnumDeviceCapabilityValue)filterCapValue;
        // get supported values of capability
        ...
        break;
}
Finally, you need set value of capability:

Code: Select all

filterCap.SetValue(X);
Best regards, Alexander

Re: Color Dropout

Posted: Wed Jun 06, 2012 12:13 pm
by Krishna
Hi Alex,

Thanks a lot for your reply. Sorry I forgot to mention that we are using Version 6.0.2.1 so I could not check your solution. Can you please give me equivalent code for Version 6?

Regards,
Krishna

Re: Color Dropout

Posted: Thu Jun 07, 2012 1:09 pm
by Alex
Hello Krishna,

Here is the code for version 6.0.

First, you need check that ICAP_FILTER capability is supported by your scanner:

Code: Select all

VSTwain1.Capability = (int)Vintasoft.Twain.DeviceCapability.IFilter;
if (!VSTwain1.IsCapSupported())
    throw new ApplicationException("ICAP_FILTER capability is not supported by device.");
Next, you need get supported values of capability:

Code: Select all

VSTwain1.GetCap();
switch (VSTwain1.CapType)
{
    case CapType.Array:
        // get supported values of capability
        ...
        break;

    case CapType.Enum:
        // get supported values of capability
        ...
        break;
}
Finally, you need set value of capability:

Code: Select all

VSTwain1.CapType = CapType.OneValue;
VSTwain1.CapValue = X;
VSTwain1.SetCap();
Best regards, Alexander

Re: Color Dropout

Posted: Thu Jun 07, 2012 1:30 pm
by Krishna
Thanks a lot Alex. This worked brilliantly. Although I had to guess the Green value to be '1' as the CapType (0 for red and 2 for blue I think) for this capability is OneValue and I could not get all the valid values.

I had a Fujitsu fi-5530C2 which seems to support this capability and Kodak I1120 scanner which doesnt support it. Is there anyway to get the Capabilities of a particular scanner (before purchasing it) so that we can recommend the client which scanner to purchase incase they need to dropout any particular color?

Re: Color Dropout

Posted: Thu Jun 07, 2012 3:46 pm
by Alex
Although I had to guess the Green value to be '1' as the CapType (0 for red and 2 for blue I think) for this capability is OneValue and I could not get all the valid values.
Here is a list of available values for ICAP_FILTER capability:
  • RED - 0
  • GREEN - 1
  • BLUE - 2
  • NONE - 3
  • WHITE - 4
  • CYAN - 5
  • MAGENTA - 6
  • YELLOW - 7
  • BLACK - 8
Is there anyway to get the Capabilities of a particular scanner (before purchasing it) so that we can recommend the client which scanner to purchase incase they need to dropout any particular color?
Most of photo scanners can dropout colors.

Best regards, Alexander