BitDepth

Description

Returns or sets the pixel bit depths for the current value of PixelType property.

Data type

<short>

Syntax

.BitDepth = ...;

Remarks

Currently this property is only valid in Windows & Mac.

Set this property after OpenSource() and before AcquireImage().

When an error occurs, check ErrorCode or ErrorString for error information.

BitDepth should be set based on the current PixelType.
For example, you can generally set 8 for 'TWPT_GRAY'(1) or 'TWPT_PALLETE'(3) but not for 'TWPT_BW'(0) or 'TWPT_RGB'(2).

'TWPT_BW'(0) always has the bitdepth of 1 and 'TWPT_GRAY'(1) is usually 8 by default and 24 for 'TWPT_RGB'(2) accordingly.

If not necessary, you don't need to set BitDepth as there usually is a default value for each PixelType.

Code Snippet

DWObject.SelectSource(); 
DWObject.OpenSource();
DWObject.IfShowUI=false;
DWObject.PixelType=1;
DWObject.BitDepth=8;
DWObject.AcquireImage();

See also

PixelType

Is this page helpful?

Leave a Reply

Your email address will not be published.