Question

I'm trying to configure the color and depth in a Kodak i2600 scanner using WIA on a C# project. Several posts refer to parameters 6146 (which can take the values ​​1 (color), 2 (gray scale) or 4 (white and black)) and 4104 (color depth = 24).

WIA Automation for scanner color intent is not working

Windows image acquisition - setting device properties in C#

Detect all available scanner resolutions using WIA

These properties do not appear when I iterate the array scanner properties.

I use a foreach loop to iterate properties and this is the list that I get:

  • 3112: User Name: *******
  • 4098: Item Name: Root
  • 4099: Full Item Name: 0000 \ Root
  • 4101: Item Flags: 76
  • 2: Unique Device ID: {613DD1FC6 - 810E- 1100 - 13EC7- 0800213E2092F} \ 0000
  • 3: Manufacturer: Kodak
  • 4: Description: KODAK i2600 Scanner
  • 5: Type: 65537
  • 6: Port: \ AUsbscan0
  • 7: Name: KODAK i2600 Scanner
  • 8: Server: local
  • 9: Remote Device ID:
  • 10: Ul Class ID: {40131AD10 - 3391 - 11D2- 9A33- 00C04FA36145}
  • 11: Hardware Configuration: 0
  • 12: 8audRate:
  • 13: STI Generic Capabilities: 49
  • 14: WIA Version: 2.0
  • 15: Driver Version: 1.1.0.0
  • 16: PnP ID String: usb=vid 040a&pid 601d=0000000000000000={6bddlfc6- 810f- 11d0- bec7- 0800 2be2092f}
  • 17: STI Driver Version: 3
  • 4125: Item Category: {F193526F- 5988- 4A26- 9888- E16E4F97CE10}
  • 1026: Firmware Version: 0
  • 3086: Document Handling Capabilities: 8229
  • 3087: Document Handling Status: 5
  • 3095: Max Scan Time: 3600000
  • 3090: Horizontal Optical Resolution: 600
  • 3091: Vertical Optical Resolution: 600
  • 3103: Show preview control: 0
  • 3098: Page Width: 8500
  • 3099: Page Height: 14000
  • 3096: Pages: 0
  • 3076: Horizontal Sheet Feed Size: 8500
  • 3077: Vertical Sheet Feed Size: 14000
  • 3088: Document Handling Select: 1
  • 3078: Sheet Feeder Registration: 1
  • 3104: Minimum Horizontal Sheet Feed Size: 1000
  • 3105: Minimum Vertical Sheet Feed Size: 1000
  • 3100: Preview: 0

The scanner drivers are updated.

Was it helpful?

Solution

I was with same problem (kodak i2400).

If you want, try this:

WIA.Item item = device.Items[1] as WIA.Item;

AdjustScannerSettings(item, 150, 0, 0, 1250, 1700, 0, 0, 1);


private static void AdjustScannerSettings(IItem scannnerItem, int scanResolutionDPI, int scanStartLeftPixel, int scanStartTopPixel,
        int scanWidthPixels, int scanHeightPixels, int brightnessPercents, int contrastPercents, int colorMode)
{
    const string WIA_SCAN_COLOR_MODE = "6146";
    const string WIA_HORIZONTAL_SCAN_RESOLUTION_DPI = "6147";
    const string WIA_VERTICAL_SCAN_RESOLUTION_DPI = "6148";
    const string WIA_HORIZONTAL_SCAN_START_PIXEL = "6149";
    const string WIA_VERTICAL_SCAN_START_PIXEL = "6150";
    const string WIA_HORIZONTAL_SCAN_SIZE_PIXELS = "6151";
    const string WIA_VERTICAL_SCAN_SIZE_PIXELS = "6152";
    const string WIA_SCAN_BRIGHTNESS_PERCENTS = "6154";
    const string WIA_SCAN_CONTRAST_PERCENTS = "6155";

    SetWIAProperty(scannnerItem.Properties, WIA_HORIZONTAL_SCAN_RESOLUTION_DPI, scanResolutionDPI);
    SetWIAProperty(scannnerItem.Properties, WIA_VERTICAL_SCAN_RESOLUTION_DPI, scanResolutionDPI);
    SetWIAProperty(scannnerItem.Properties, WIA_HORIZONTAL_SCAN_START_PIXEL, scanStartLeftPixel);
    SetWIAProperty(scannnerItem.Properties, WIA_VERTICAL_SCAN_START_PIXEL, scanStartTopPixel);
    SetWIAProperty(scannnerItem.Properties, WIA_HORIZONTAL_SCAN_SIZE_PIXELS, scanWidthPixels);
    SetWIAProperty(scannnerItem.Properties, WIA_VERTICAL_SCAN_SIZE_PIXELS, scanHeightPixels);
    SetWIAProperty(scannnerItem.Properties, WIA_SCAN_BRIGHTNESS_PERCENTS, brightnessPercents);
    SetWIAProperty(scannnerItem.Properties, WIA_SCAN_CONTRAST_PERCENTS, contrastPercents);
    SetWIAProperty(scannnerItem.Properties, WIA_SCAN_COLOR_MODE, colorMode);
}

private static void SetWIAProperty(IProperties properties, object propName, object propValue)
{
    Property prop = properties.get_Item(ref propName);
    prop.set_Value(ref propValue);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top