ImageGear for C and C++ on Windows v19.10 - Updated
IG_IC_invert_white_text
API Reference Guide > ImageClean Component API Reference > ImageClean Component Functions Reference > IG_IC_invert_white_text

This function automatically detects areas of white text on black backgrounds in 1-bit images, and inverts them so that they become black text on white backgrounds.

Declaration:

 
Copy Code
AT_ERRCOUNT IG_IC_invert_white_text ( 
        HIGEAR hIGear, 
        INT MinX, 
        INT MinY, 
        INT MinT
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
MinX INT Minimal width of the region to be considered.
MinY INT Minimum height of the region to be considered.
MinT INT Minimum "thickness" of spaces that fall in between sections of text that will be inverted.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

Indexed RGB – 1 bpp.

Sample:

ImageClean

Remarks:

This function scans your entire image and makes adjustments to all areas of white text on black that fall within the scope of your settings.

The arguments MinX and MinY tell ImageGear the minimum width and height (respectively) for areas that you would like to invert. For example, if you set MinX = 60 and MinY = 20, ImageGear will only invert sections of white text on black background that have a minimum width of 60 pixels and a minimum height of 20 pixels. The third argument of this function, MinT, sets the minimum "thickness" of spaces that fall in-between sections of text that will be inverted. This minimum value tells ImageGear what sections of text should be treated as all one section based on how close they are to one another. As an example: let's say you have three adjacent sections of white text on black backgrounds that contain the words: "There" "is" "hope." If "There" and "hope" meet your minimum size requirements they will be inverted. If "is" is below your minimum size requirements and you have not set MinT, "is" will note be inverted and your final result will be that "There" and "hope" look normal, while "is" remains as white text on black background. To keep this from happening (if you so desire), you would need to set MinT to a value small enough to include the spaces before and after the word "is". This way all the words would be treated as one section and inverted together.

Refer to the Component Manager API section.

See also IG_IC_invert_white_text_ex() function.