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

C++

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

C#

void GetTextBackgroundColor(
  int     Left,
  int     Top,
  int     Right,
  int     Bottom,
  int     Flags,
  out int TextColor,
  out int BackgroundColor
);
    

Visual Basic .NET

Sub GetTextBackgroundColor( _
  Left As Integer, _
  Top As Integer, _
  Right As Integer, _
  Bottom As Integer, _
  Flags As Integer, _
  ByRef TextColor As Integer, _
  ByRef BackgroundColor As Integer _
)
    

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

17.09.2024 15:14:40

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.