BalanceColors method (Main Control)
Visual
Basic example
Visual
C++ 5.0 example
Syntax short BalanceColors(float fRedToRed, float fRedToGreen, float fRedToBlue, float fGreenToRed, float fGreenToGreen, float fGreenToBlue, float fBlueToRed, float fBlueToGreen, float fBlueToBlue);
Overview: Refer to Correcting Colors.
Remarks
Redistributes the RGB values of the specified bitmap, using the values stored in the specified structures.
For each pixel in the bitmap, the red value is modified using the values of the fRedToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.
For each pixel in the bitmap the green value is modified using the values of the fGreenToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.
For each pixel in the bitmap the blue value is modified using the values of the fBlueToXXX parameters. This generates an intermediate red value, an intermediate green value and an intermediate blue value.
The intermediate red values are added to generate the new red value for the pixel. The intermediate green values are added to generate the new green value for the pixel and the intermediate blue values are added to generate the new blue value for the pixel. This triplet forms the new RGB value for the pixel.
For example, if a the following parameter values are used to redistribute the red value of a pixel:
fRedToRed |
= |
0.50 |
fRedToGreen |
= |
0.50 |
fRedToBlue |
= |
0.0 |
Then 50% of the current red value of the pixel will be added to the new red value for the pixel and 50% of the current red value of the pixel will be added to the new green value for the pixel.
This method supports 48 and 64-bit color images. Support for 48 and 64-bit color images is available only in the Document/Medical toolkits.
See Also
Elements: ConvertToColoredGray method, GrayScale method, GrayscaleExt method, IsGrayscale property