VintaSoft Twain .NET SDK Discussions

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Board index < VintaSoft Twain < VintaSoft Twain .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Color Dropout



Color Dropout

Post 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

Post by Alex »

Hello Krishna,

First, you need check that ICAP_FILTER capability is supported by your scanner:
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:
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:
filterCap.SetValue(X);
Best regards, Alexander


Re: Color Dropout

Post 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

Post 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:
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:
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:
VSTwain1.CapType = CapType.OneValue;
VSTwain1.CapValue = X;
VSTwain1.SetCap();
Best regards, Alexander


Re: Color Dropout

Post 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

Post 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


Page 1 from 1: 1