Click or drag to resize

ImageFileConvert2BW Method

This method can be used to convert one or more pages of the image file to black-and-white (bi-tonal, one-bit color depth).

Namespace:  Kofax.OmniPageCSDK.IproPlus
Assembly:  Kofax.OmniPageCSDK.IproPlus (in Kofax.OmniPageCSDK.IproPlus.dll) Version: 1.0.0.0
Syntax
public void Convert2BW(
	IMG_CONVERSION Conversion,
	[OptionalAttribute] int Brightness,
	[OptionalAttribute] int Threshold,
	[OptionalAttribute] IMG_RESENH ResolEnh,
	[OptionalAttribute] int Page
)

Parameters

Conversion
Type: Kofax.OmniPageCSDK.IproPlusIMG_CONVERSION
Brightness (Optional)
Type: SystemInt32
Threshold (Optional)
Type: SystemInt32
ResolEnh (Optional)
Type: Kofax.OmniPageCSDK.IproPlusIMG_RESENH
Page (Optional)
Type: SystemInt32
Remarks

If this method is called for a B/W image, no conversion is performed.

The Conversion parameter specifies the conversion mode used for the operation. For all available IMG_CONVERSION values see the description of the Conversion property of the Document object. Only CNV_AUTO, CNV_SET or CNV_GLOBAL can be specified for this method, other IMG_CONVERSION values result in a trappable error.

The optional Brightness numeric parameter is ignored unless the Conversion parameter is CNV_AUTO. It determines the converted image's brightness in the 0 - 100 range. The larger the value, the brighter the result. If this parameter is unspecified, the default value of 50 is used for the conversion.

The optional Threshold numeric parameter is ignored unless the Conversion parameter is CNV_SET. It determines the threshold value used for the conversion in the 0 - 255 range. If this parameter is unspecified, the default value of 127 is used for the conversion.

The ResolEnh optional parameter is of type IMG_RESENH which specifies whether or not resolution enhancement is applied to the image during conversion. To see the available values for this property, see the description of the ResEnhancement property of the Document object. For this parameter, the RE_AUTO resolution enhancement mode is equivalent to the RE_LEGACY mode setting. If the parameter is unspecified, the default value RE_NO is used.

The Page is an optional long parameter. If the optional Page parameter is unspecified or -1 all pages will be processed. Otherwise only the one specified by the Page index is processed.

This method can only be used with multi-page image TIFF files. A further requirement is that the pages in the multi-page TIFF file must be stored in one-strip format and the StripBytesCount TIFF tag must exist in the page header. Note that TIFF image files created by the Capture SDK fulfill this requirement.

See Also