 | ImagingProcessingConvertRgbToGrayscaleImage Method (Bitmap, Double, Double, Double) |
Converts a color to a grayscale image (bitmap format Format8bppIndexed)
by calculating grayscale values according to the specified color component coefficients.
Namespace:
Ranorex
Assembly:
Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntaxpublic static Bitmap ConvertRgbToGrayscaleImage(
Bitmap input,
double coeffR,
double coeffG,
double coeffB
)
Public Shared Function ConvertRgbToGrayscaleImage (
input As Bitmap,
coeffR As Double,
coeffG As Double,
coeffB As Double
) As Bitmap
Parameters
- input
- Type: System.DrawingBitmap
A color image. - coeffR
- Type: SystemDouble
The coefficient for the red color component. - coeffG
- Type: SystemDouble
The coefficient for the green color component. - coeffB
- Type: SystemDouble
The coefficient for the blue color component.
Return Value
Type:
BitmapA grayscale image.
Exceptions| Exception | Condition |
|---|
| ArgumentNullException | If input is null. |
| ArgumentException | If the input image cannot
be converted to Format24bppRgb pixel format (i.e. if
it is no color image in a 32 bit format). |
See Also