This method retrieves the possible setting values for a specified property of the scan device.

[C++Builder]   [ int = ]imagekitcontrolname->Scan->GetCapEnumToFloat(Word CapNo, short &ConType, float * List, const int List_Size, int &CurrentIndex, int &DefaultIndex)
[Delphi]   [ Integer = ]imagekitcontrolname.Scan.GetCapEnumToFloat(CapNo: Word; var ConType: Smallint; var List: array of Single; var CurrentIndex, DefaultIndex: Integer)

Parameters

Name Explanation
CapNo The number for the retrieved property (in hexidecimal)

   0x0100   Compression method

   0x0101   Pixel type

   0x0102   Scan units of measurement

   0x0103   Method of transfer

   0x1101   Brightness

   0x1103   Contrast

   0x1108   Gamma

   0x1109   Halftone

   0x110a   Highlight

   0x110c   File Format

   0x110e   Dropout color

   0x1110   Paper orientation

   0x1113   Shadow

   0x1118   Horizontal resolution

   0x1119   Vertical resolution

   0x1121   Rotation angle

   0x1122   Paper size

   0x1123   Threshold

   0x1124   Horizontal scaling

   0x1125   Vertical scaling

   0x112c   Method of color reduction

   0x1147   Image filter

   0x1148   Noise filter

   0x1149   OverScan

   0x1153   JPEG quality coefficient

   0x115c   Double sided merge

   0xf001   Scanning speed

   0xf002   Moire filter

   0xf004   Sharpness

   0xf006   Extended UiMode

   0xf007   Dynamic threshold

   0xf00b   Skip blank page

   0xf00e   Text enhancement

   0xf00f   Border

In Delphi, replace 0x with $.

 

The following constants can be used: (vikScanCompression = 0x0100, vikScanPixelType = 0x0101, vikScanUnits = 0x0102, vikScanTransferMode = 0x0103, vikScanFeederEnabled = 0x1002, vikScanFeederLoaded = 0x1003, vikScanIndicator = 0x100b, vikScanUiControllable = 0x100e, vikScanDeviceonline = 0x100f, vikScanThumbnailsEnabled = 0x1011, vikScanDuplex = 0x1012, vikScanEnableDSUIOnly = 0x1014, vikScanCustomDSData = 0x1015, vikScanBrightness = 0x1101, vikScanContrast = 0x1103, vikScanGamma = 0x1108, vikScanHalfTone = 0x1109, vikScanHighlight = 0x110a, vikFileScanFormat = 0x110c, vikScanDropoutColor = 0x110e, vikScanOrientation = 0x1110, vikScanShadow = 0x1113, vikScanXResolution = 0x1118, vikScanYResolution = 0x1119, vikScanRotation = 0x1121, vikScanPaperSize = 0x1122, vikScanThreshold = 0x1123, vikScanXScaling = 0x1124, vikScanYScaling = 0x1125, vikScanBitDepthReduction = 0x112c, vikScanUndefinedImagesize = 0x112d, vikScanImageDataset = 0x112e, vikScanImageFilter = 0x1147, vikScanNoiseFilter = 0x1148, vikScanOverScan = 0x1149, vikScanBorderDetection = 0x1150, vikScanDeskew = 0x1151, vikScanJpegQuality = 0x1153, vikScanImageMerge = 0x115c, vikScanScanningSpeed = 0xf001, vikScanMoirefilter = 0xf002, vikScanMoirefilterMaxResolution = 0xf003, vikScanSharpness = 0xf004, vikScanRotateBack = 0xf005, vikScanExtUiMode = 0xf006, vikScanDynamicThreshold = 0xf007, vikScanPixelAutomationCap = 0xf008, vikScanMultiStream = 0xf009, vikScanTextOrientationRecognition = 0xf00a, vikScanSkipBlankPage = 0xf00b, vikScanRemoveHole = 0xf00c, vikScanFocusPosition = 0xf00d, vikScanTextEnhancement = 0xf00e, vikScanBorder = 0xf00f).

ConType A variable that contains the type of the retrieved property value (see below)
List An array containing the retrieved values (In C++Builder, the number of items in the array - 1 is passed to List_Size)
CurrentIndex

The index referring to the current value of the List (the index starts from 0)

List[CurrentIndex] = current value

DefaultIndex The index referring to the default value of the List (the index starts from 0)

List[DefaultIndex] = default value

Return Value

If ConType=3 or 4, then the number is retrieved
If ConType=5 then 1 is returned, if ConType=6 then 5 is returned (these are constants).
If List is NULL then the number of elements in the appropriate array are returned.
If 0 is returned then there was an error. Please refer to the error status.

Explanation

The GetCapEnumToFloat method retrieves the possible setting values for a specified property of the scan device. To retrieve the possible setting values for a property it is first necessary to set the DataSourceName property. If the DataSourceName property is blank then please execute the Select method prior to executing the GetCapEnumToFloat method. (Note: If the OpenDataSource method is executed prior to the GetCapEnumToFloat method the the DataSourceName property is disabled and the open datasource is used).

Depending on the scanner being used, it is possible that the range acceptable resolution values will differ according to the pixel type setting (1 bit color or 24 bit color). Also, depending on the type of transfer mode used (memory or file), the type of compression values possible may differ. Because of this, before retreiving the range of possible XDpi and YDpi values, you should first set the PixelType property and before retrieving the possible compression values, you should first set the TransferMode property.

To execute the GetCapEnumToFloat method you must first execute the Initialize method.
If the OpenDataSource method is executed prior to executing the GetCapEnumToFloat method then the open datasource cannot be used by another application until that datasource (scan device) is closed.

The GetCapEnumToFloat method corresponds to the Scan Control's ScanGetCapEnum method in earlier versions of the ImageKit.

 

Regarding ConType values

(0: Method return value is 0, 3: an array is returned, 4 a list is returned, 5: a single value is returned, 6: a range is returned)

If ConType=3, then the values of the List array are set and CurrentIndex and DefaultIndex are disabled.
If ConType=4, then the values of the List array are set.
If ConType=5, then the current value is set in the first element, List[0], of the List array.
If ConType=6, then minimum value is set in the first element, List[0], of the List array; the maximum value is set in the second element, List[1], the step value is set in the third element, List[2], the default value is set in the fourth element, List[3], and the current value is set in the fifth element, List[4].

Regarding the values set into the List array

When CapNo refers to the compression method:

0: uncompressed, 1: PACKBITS, 2: GROUP3-1D, 3: GROUP3-1DEOL, 4: GROUP3-2D, 5: GROUP4, 6: JPEG, 7: LZW, 8: JBIG, 9:PNG, 10: RLE4, 11: RLE8, 12: BITFIELDS (2, 3, 4, 5 are FAX[CCITT], 10, 11, and 12 are BMP)

When CapNo refers to PixelType:

0: Black and White - (2 bits), 1: Grayscale, 2: RGB color, 3: Palette color
(Depending on the datasource, values can also range from 4 to 8)

When CapNo refers to Scan Units:

0: Inches, 1: Centimeters, 2: Pica, 3: Points, 4: Twips, 5: Pixels, 6: Millimeters

When CapNo refers to the method of transfer:

0: Native, 1: File, 2: Memory, 3: File2

When CapNo refers to the file format:

0: TIFF, 1: PICT, 2: BMP, 3: XBM, 4: JFIF(JPEG), 5: FPX, 6: TIFF MULTI, 7: PNG, 8: SPIFF, 9: EXIF, 10: PDF, 11: JP2 (JPEG2000 Part1), 13: JPX(JPEG2000 Part2), 14: DEJAVU, 15: PDF/A(Version1), 16: PDF/A(Version2)

When CapNo refers to the Dropout color:

0: Red, 1: Green, 2: Blue, 3:None, 4: White
(Depending on the datasource, values 5, 6 can be set)

When CapNo refers to the orientation of the paper:

0: 0 degrees (Portrait), 1: 90 degrees, 2: 180 degrees, 3: 270 degrees (Landscape)

When CapNo refers to paper size:

0: User defined size, 1: A4, 2: JIS B5, 3: US letter, 4: US legal, 5: A5, 6: ISO B4, 7: ISO B6, 9: US ledger, 10: US executive, 11: A3, 12: ISO B3, 13: A6, 14: C4, 15: C5, 16: C6, 17: 4A0, 18: 2A0, 19: A0, 20: A1, 21: A2, 22: A7, 23: A8, 24: A9, 25: A10, 26: ISO B0, 27: ISO B1, 28: ISO B2, 29: ISO B5, 30: ISO B7, 31: ISO B8, 32: ISO B9, 33: ISO B10, 34: JIS B0, 35: JIS B1, 36: JIS B2, 37: JIS B3, 38: JIS B4, 39: JIS B6, 40: JIS B7, 41: JIS B8, 42: JIS B9, 43: JIS B10, 44: C0, 45: C1, 46: C2, 47: C3, 48: C7, 49: C8, 50: C9, 51: C10, 52: US statement, 53: Business card, 54: Maximum size, 1000 Undefined

When CapNo refers to reduction of color depth:

0: Threshold, 1: HalfTone, 2: Custom HalfTone, 3: Diffusion, 4: Dynamic Threshold

When CapNo refers to the noise filter:

0: None, 1: Automation, 2: LOWPASS, 3: BANDPASS, 4: HIGHPASS

When CapNo refers to the image filter:

0: None, 1: Automation, 2: LONEPIXEL, 3: MAJORITYRULE

When CapNo refers to the OverScan:

0: Uses the set scan size to scan, 1: Considers the scan size setting and automatically scans, 2: Uses the scan size setting as a base then increases the top and bottom dimensions to scan, 3: Uses the scan size setting as a base then increases the left and right dimensions to scan, 4: Uses the scan size setting as a base then increases the top, bottom, left, and right dimensions to scan

When CapNo refers to the scanning speed:

This is enabled only for certain Epson and Panasonic scanners
(1) Epson Scan Drivers - 0: For Quality, 1: For Speed
(2) Panasonic Scan Drivers - 0: Slow, 1: Normal, 2: Fast

When CapNo refers to the moire filter:

This is enabled only for certain Epson scanners, Canon DR scanners, and PFU Scanners.
(1) Epson Scan Drivers - 0: None, 1: Standard, 2: 85lpi (For Newspapers), 3: 133lpi (for Magazines and Catalogs), 4: 175lpi (for Photographs)
(2) Canon DR Scan Drivers - 1: None, 2: High Speed Scanning, 3: High Quality Scanning
(3) PFU Scan Drivers - 0: None, 1: Moire Filter level1, 2: Moire Filter level2, 3: Moire Filter level3, 4: Moire Filter level4

When CapNo refers to Sharpness:

This is enabled only for certain Canon DR scanners, Epson scanners, Panasonic scanners, and PFU scanners.
For Canon DR scanners it is known as "edge enhancement", for Epson scanners it is known as "unsharp mask", for Panasonic scanners it is known as "image quality", and for PFU scanners, it is know as "outline enhancement".
(1) Canon DR Scan Drivers - From 1 to 5
(2) Epson Scan Drivers - 0: None, 1: Small, 2: Medium (default), 3: Large
(3) Panasonic Scan Drivers - 0: None, 1: Smooth, 2: Low, 3: Standard, 4: High
(4) PFU Scan Drivers - 0: None (Default), 1: Weak outline enhancement, 2: Medium outline enhancement, 3: Strong outline enhancement

When CapNo refers to the Extended UiMode:

This is enabled only for certain Epson scanners
0: Starts up the UI mode that was last used, 1: Starts up the professional mode, 2: Starts up the automatic mode, 3: Starts up the home mode, 4: Starts up the automatic mode (with no error messages and supressed UI), 5: Starts up office mode

When CapNo refers to the dynamic threshold:

This is enabled only for certain Panasonic scanners

0: None, 1: Bright, 2: A little brighter, 3: Standard, 4: A little darker, 5: Dark

When CapNo refers to the text enhancement:

This is enabled only for certain Canon DR scanners and certain Epson scanners
(1) Canon DR scanner:
0: Text enhancement is not used (default), 1: Text enhancement is used, 2: Advanced text enhancement is used, 3: High speed text enhancement is used, 4,5: Advanced text enhancement II is used. (Value depends on the functions used)
(2) Epson scanners:
0: Character distinction is not used. (default), 1: Standard character distinction is used, 2: Strong character distinction is used

When CapNo refers to Brightness, Contrast, Gamma, Highlight, Shadow, XResolution, YResolution, Rotation angle, Threshold, XScaling, YScaling, and JPEG quality coefficient, SkipBlankPage then the value returned will be the possible setting value for that property.

Note: when ConType=6, the result will be the same as that returned from the GetCapRange method.

Example code

In C++Builder

int Num;
float *List;
short ConType;
int CurrentIndex, DefaultIndex;

Num = VImageKit1->Scan->GetCapEnumToFloat(0x0102, ConType, NULL, 0, CurrentIndex, DefaultIndex);
if (Num == 0) return;
List = new float[Num];
VImageKit1->Scan->GetCapEnumToFloat(0x0102, ConType, List, Num - 1, CurrentIndex, DefaultIndex);
//You code goes here
delete[] List;

In Delphi

Num: Integer;
List: array of Single;
ConType: Smallint;
CurrentIndex, DefaultIndex: Integer;

Num := VImageKit1.Scan.GetCapEnumToFloat($0102, ConType, PSingle(nil)^, CurrentIndex, DefaultIndex);
if Num = 0 then Exit;
SetLength(List, Num);
VImageKit1.Scan.GetCapEnumToFloat($0102, ConType, List, CurrentIndex, DefaultIndex);
//You code goes here

Differences from the ImageKit7/8/9 ActiveX

This method corresponds to the GetCapEnum method but the CapNo for halftone cannot be used
In VCL, constants contain a "v".

Differences from the ImageKit7 ActiveX

Rotation, OverScan, SkipBlankPage, and TextEnhancement values have been added to CapNo

Differences from the ImageKit8 ActiveX

Duplex values have been added to CapNo

 

The ImageKit9 VCL is a product created by Newtone Corporation