Chinese Simplified (简体中文)

GetTextBackgroundColor Method of the ImageDocument Object

This method detects colors of text and background in the specified rectangle on image. This rectangle should be specified in the coordinates against the deskewed black-and-white page of the ImageDocument.

Syntax

HRESULT GetTextBackgroundColor(
  int  Left,
  int  Top,
  int  Right,
  int  Bottom,
  int  Flags,
  int* TextColor,
  int* BackgroundColor
);
    

Parameters

Left
[in] This parameter contains coordinate of the left border of the rectangle.
Top
[in] This parameter contains coordinate of the top border of the rectangle.
Right
[in] This parameter contains coordinate of the right border of the rectangle.
Bottom
[in] This parameter contains coordinate of the bottom border of the rectangle.
Flags
[in] This parameter may either be 0 or DCR_Invert constant of the DetectColorRegionFlags module. If DCR_Invert is passed, then the rectangle is considered to be inverted (white text against the black background).
TextColor
[out] This parameter receives the value of the text color in rectangle.
BackgroundColor
[out] This parameter receives the value of the background color in rectangle.

Return values

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

Remarks

Text and background colors are detected using information from the deskewed black-and-white page of the ImageDocument. But the colors are returned as they are on the color pages of the ImageDocument. A pixel of the deskewed black-and-white image plane that lies inside the specified rectangle is considered to be part of the text if it is black (for the rectangle which was not inverted) or white (for the rectangle which was inverted). If this method fails to detect the colors of text and/or background, it returns the undefined color value (0xFFFFFFFF).

See also

ImageDocument

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.