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

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

Parameters

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

0x1109   Halftone

In Delphi, replace 0x with $.

The following constants can be used: (vikScanHalfTone = 0x1109).

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

Returns the retrieved number
If 0 is returned then there was an error. Please refer to the error status.

Explanation

The GetCapEnumToString 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 GetCapEnumToString method. (Note: If the OpenDataSource method is executed prior to the GetCapEnumToString 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 GetCapEnumToString method you must first execute the Initialize method.
If the OpenDataSource method is executed prior to executing the GetCapEnumToString method then the open datasource cannot be used by another application until that datasource (scan device) is closed.

The GetCapEnumToString 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 halftone

The name referring to the halftone is set.

Example code

In C++Builder

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

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

In Delphi

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

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

Differences from the ImageKit7/8/9/10 ActiveX

This method corresponds to the GetCapEnum method to retrieve the CapNo for halftone
In VCL, constants contain a "v".

 

The ImageKit10 VCL is a product created by Newtone Corporation