Chinese Simplified (简体中文)

AddReplaceWhitePixelsRegion Method of the ImageModification Object

This method adds a new "replace white pixels" region to the internal array of "replace white pixels" regions of the ImageModification object. To remove all the "replace white pixels" regions previously added call the IImageModification::ClearReplaceWhitePixelsRegions method. If the modification must be applied to a single color (or gray) plane of the image, coordinates of the region should be specified on this color (gray) plane. If the modification must be applied to the whole ImageModification, the coordinates should be specified on the deskewed black-and-white image plane.

Syntax

HRESULT AddReplaceWhitePixelsRegion(
  IRegion* Region,
  int      Color,
  int      StrokesExpansion
);
    

Parameters

Region
[in] This parameter of the Region type specifies the "replace white pixels" region to be added.
Color
[in] This variable specifies the color with which the white pixels are replaced. The value of this parameter can be -1, which means that the color is transparent.

Note: The int value is calculated from the RGB triplet using the formula: (red value) + (256 x green value) + (65536 x blue value), where red value is the first triplet component, green value is the second triplet component, blue value is the third triplet component. For example, the int value of the color white equals 16777215.

StrokesExpansion
[in] This variable specifies the expansion (in pixels) of black areas on the image before replacing. This parameter must be non-negative.

Return values

This method has no specific return values. It returns the standard return values of ABBYY FineReader Engine functions.

Remarks

White pixels on the image inside the "replace white pixels" regions will be replaced with the pixels of the specified color when IImageDocument::Modify method is applied. This operation is performed on the black-and-white image plane but results will be applied to the gray and color image planes too.

See also

ImageModification

ClearReplaceWhitePixelsRegions

7/3/2024 8:50:25 AM

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.