ImageGear Professional for Windows ActiveX
InvertContrast Method

Description:

Inverts every color to its complement in an image. For black-and-white images, black will become white and white will become black. For grayscale and color images, every red, green, and blue color intensity value will be complemented: 0 will become 255 (and vice versa), 1 will become 254, and so on. Therefore, in a grayscale image, the darkest grays will become the lightest grays, and vice versa; and in a color image, colors near green will complement to colors near magenta (the complement of green), and so on.

If ContrastOptions Property.Mode = IG_CONTRAST_PIXEL, the inversion is accomplished by inverting all bits of all pixels within lpRect: bits that are 1 become 0, and bits that are 0 become 1. If ContrastOptions Property.Mode = IG_CONTRAST_PALETTE, the inversion is accomplished by inverting the bits in the image's palette. (The image bitmap is left unchanged.) Note that specifying IG_CONTRAST_PALETTE inverts the entire image, ignoring any rectangle specified. Note also that for 8-bit indexed color (8i) images, inverting the pixel will produce an error; only IG_CONTRAST_PALETTE makes sense.

If the image is 24-bit, only the pixel bits can be complemented (since there is no palette), so in this case ContrastOptions Property.Mode is ignored.

In photographic terms, this function produces the "negative" of the image.

This method takes into account the ROI settings of pPage object, that are accessible via the IGPage Object.ROI Property. By default ROI is set to the entire image.

Syntax:

      InvertContrast (ByVal pPage As IGPage)

Parameters:

Name Description
pPage Reference to IGPage Object to which the contrast inverting is applied.

Return Value:

N/A

Bits Per Pixel:

Sample:

Image Processing and Effects.

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback