RanorexRanorex Documentation
Threshold Method (input, threshold)
NamespacesRanorexImaging..::.ProcessingThreshold(Bitmap, Byte)
Converts the input image to a black/white image (i.e. an image that contains only two different colors) using the specified threshold value.
Declaration Syntax
C#Visual BasicVisual C++
public static Bitmap Threshold(
	Bitmap input,
	byte threshold
)
Public Shared Function Threshold ( _
	input As Bitmap, _
	threshold As Byte _
) As Bitmap
public:
static Bitmap^ Threshold(
	Bitmap^ input, 
	unsigned char threshold
)
Parameters
input (Bitmap)
An image.
threshold (Byte)
The threshold value that decides whether an output pixel is colored black or white. If the input value is smaller than the threshold, the output pixel is colored black, otherwise white.
Return Value
A grayscale image that contains only black and white pixels.
Remarks
If the image is not a grayscale image, it will be converted using the ConvertRgbToGrayscaleImage(Bitmap) method.
Exceptions
ExceptionCondition
ArgumentNullExceptionIf input is null.
ArgumentExceptionIf the input image is not a grayscale image and cannot be converted to Format24bppRgb pixel format (i.e. if it is no color image in a 32 bit format).

Assembly: Ranorex.Core (Module: Ranorex.Core) Version: 3.2.3.16825 (3.2.3.16825)