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

[Visual Basic]   [ Long = ]imagekitcontrolname.Scan.GetBitDepthVariant(List As Variant)
[VB.NET]   [ Integer = ]imagekitcontrolname.Scan.GetBitDepthVariant(ByRef List As Object)
[C#.NET]   [ int = ]imagekitcontrolname.Scan.GetBitDepthVariant(ref object List)

Parameters

Name Explanation
List An array containing the bit depths supported by the scan device
* NOTE for retrieving array values:
In Visual Basic /VB.NET, if the array is defined as Dim List, then the arguments are returned in List.
In C#.NET, the arguments are returned in ref List.

Return Value

The GetBitDepthVariant 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.


Explanation

The GetBitDepthVariant method retrieves the bit depth supported by the scan device.

This method is recommended when using scripting or other languages that require variant types or when using VB.NET or C#.NET.

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 GetBitDepthVariant 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 GetBitDepthVariant method.

The GetBitDepthVariant method takes the List parameter as argument. The List is an array that will contain the supported bit depth returned by the GetBitDepthVariant method.

If the GetBitDepthVariant 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 GetBitDepthVariant 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 GetBitDepthVariant method, you must execute the Initialize method.

If the OpenDS method is executed prior to the GetBitDepthVariant 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.

Also see the GetBitDepth method.

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

 

Code Example

In VB.NET

   Dim List As Object = Nothing

   Dim Ret As Boolean

   Dim Num As Integer

 

   Ret = ImageKit1.Scan.Initialize(Handle.ToInt32(), 1, 0, "1.00", "NEWTONE Corp.", "ImageKit", "ImageKit Scan Sample")

   ImageKit1.Scan.PixelType = ImageKit10Lib.ScanPixelTypeConstants.ikScanPixelGray

   Num = ImageKit1.GetDepthVariant(List)

   Ret = ImageKit1.Scan.Terminate()

 

In C#.NET

   bool Ret;

   object List = null;

 

   Ret = ImageKit1.Scan.Initialize(Handle.ToInt32(), 1, 0, "1.00", "NEWTONE Corp.", "ImageKit", "ImageKit Scan Sample");

   ImageKit1.Scan.PixelType = ImageKit10Lib.ScanPixelTypeConstants.ikScanPixelGray;

   int Num = ImageKit1.GetDepthVariant(ref List);

   Ret = ImageKit1.Scan.Terminate();

The ImageKit10 ActiveX is a product created by Newtone Corporation