Color Dropout

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

Moderator: Alex

Post Reply
Krishna
Posts: 3
Joined: Thu May 31, 2012 3:56 pm

Color Dropout

Post by Krishna » Thu May 31, 2012 4:02 pm

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

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Color Dropout

Post by Alex » Sat Jun 02, 2012 9:53 am

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

Krishna
Posts: 3
Joined: Thu May 31, 2012 3:56 pm

Re: Color Dropout

Post by Krishna » Wed Jun 06, 2012 12:13 pm

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

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Color Dropout

Post by Alex » Thu Jun 07, 2012 1:09 pm

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

Krishna
Posts: 3
Joined: Thu May 31, 2012 3:56 pm

Re: Color Dropout

Post by Krishna » Thu Jun 07, 2012 1:30 pm

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?

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Color Dropout

Post by Alex » Thu Jun 07, 2012 3:46 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest