GrayscaleExt method (Main Control)

Visual Basic example
Visual C++ 5.0 example

Syntax short GrayscaleExt(short iRedFact, short iGreenFact, short iBlueFact);

Overview:  Refer to Examining and Altering Bitmaps.

Remarks

Converts any Bitmap to a grayscale bitmap without changing its resolution.

iRedFact + iGreenFact + iBlueFact must equal 1000. (Internally the values are divided by 1000).

For each pixel in the bitmap the red, green and blue values are modified by the iRedFact, iGreenFact and iBlueFact parameters, respectively. This allows the user to give more weight to one color, essentially enhancing that color, before the pixel is converted to grayscale.

For example, if this method is called with iRedFact set to 500, iGreenFact set to 250 and iBlueFact set to 250, the red value of each pixel will get 50% of the weight when determining the grayscale value. The green value will get 25% of the weight and the blue value will get 25% of the weight when determining the grayscale value. This highlights or enhances the red in the bitmap, prior to conversion to grayscale.

This method supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale images and 48 and 64-bit color images is available only in the Document/Medical toolkits.

See Also

Elements:  GrayScale method, IsGrayscale property, ConvertToColoredGray method, BalanceColors method, SwapColors method

Topics:  Raster Images: Doing Color Expansion or Reduction