This method retrieves the bit depth supported by the scan device.

[Visual Basic]   [ Long = ]imagekitcontrolname.Scan.GetBitDepth(List As Integer, ListNum As Integer)
[Visual C++]     [ long = ]imagekitcontrolname.GetScan().GetBitDepth(short *List, short ListNum)
[VB.NET]   [ Integer = ]imagekitcontrolname.Scan.GetBitDepth(List As Short, ListNum As Short)
[C#.NET]   [ int = ]imagekitcontrolname.Scan.GetBitDepth(short List, short ListNum)

Parameters

Name Explanation
List An array containing the bit depths supported by the scan device
ListNum The number of elements in the List array
* NOTE for retrieving array values:
In Visual Basic, if the array is defined as Dim List(0 To 3) As Integer, then the arguments are returned in List(0).
In Visual C++, pass the pointer to the first element in the array.
In VB.NET, the arguments are returned in List(0).
In C#.NET, the arguments are returned in List[0].

Return Value

When the List and ListNum parameters are set:

The GetBitDepth method's return value will indicate the number of supported bit depth types for the specified PixelType. If 0 is returned this would indicate an error and you can confirm the type of error using the ErrorStatus property.

 

When the List is set to NULL(Visual c++) or the ListNum is set to 0

The GetBitDepth method's return value will indicate the number of elements that need to be used in the List array.

 

Note: Some scan devices will return all supported bit depths regardless of the settings of the PixelType property. In this case the return value of the GetBitDepth method will be larger than the actual supported number of bit depths.

Explanation

The GetBitDepth method retrieves the bit depth supported by the scan device. To execute this method the DsName property, specifing the scan device, must be set or the scan device must be selected using the Select method. (Note: If the OpenDS method has been executed then the DsName property is disabled and the opened scan device will be used).

The supported bit depth retrieved by the GetBitDepth method depends on the value set in the PixelType property. Therefore the PixelType property must also be set. The PixelType property determines the type of scan, either black and white, grayscale, palette color, or RGB color. So, for example, to find out whether your scanner supports 4 bit or 8 bit palette color, you would set the PixelType property to 3 (ikScanPixelPalette) then execute the GetBitDepth method.

The GetBitDepth method takes the List and ListNum parameters as arguments. The List is an array that will contain the supported bit depth returned by the GetBitDepth method. The ListNum is merely the number of elements in the ListNum array.

If the GetBitDepth method executes successfully then the returned value will give the number of supported bit depth types for the specified PixelType. To use the example above where the PixelType property is set to 3 (ikScanPixelPalette), if the GetBitDepth method returns a value of 2 then we know that the scanner supports two types of bit depths when scanning in palette color. Then by checking the values returned in the List parameter array, we can confirm that these bit depths are actually supported if a 4 and an 8 are returned.

Depending on the scanner being used, it is possible that the range of bitcounts that can be used will differ according to the type of transfer mode used. Because of this, it is recommended that you set the TransferMode property before setting PixelType property.

Prior to executing the GetBitDepth method, you must execute the Initialize method.

If the OpenDS method is executed prior to the GetBitDepth method, then while the scan device is open, other applications can not use that scan device and it becomes the exclusive datasource for this execution.

For scripting languages and other programs that require variant types or for VB.NET or C#.NET, please refer to the GetBitDepthVariant method.

The GetBitDepth method corresponds to the Scan Control's ScanGetBitDepth method in earlier versions of the ImageKit.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation