RanorexRanorex Documentation
Preprocess Method (image, grayscale, edges, threshold, scaleWidth, scaleHeight, offset)
NamespacesRanorexImaging..::.ProcessingPreprocess(Bitmap, Boolean, Boolean%, Boolean, Double, Double, Point%)
Preprocesses the specified image by converting it to a grayscale image, detecting object edges, thresholding, and/or resizing/scaling it.
Declaration Syntax
C#Visual BasicVisual C++
public static Bitmap Preprocess(
	Bitmap image,
	bool grayscale,
	ref bool edges,
	bool threshold,
	double scaleWidth,
	double scaleHeight,
	out Point offset
)
Public Shared Function Preprocess ( _
	image As Bitmap, _
	grayscale As Boolean, _
	ByRef edges As Boolean, _
	threshold As Boolean, _
	scaleWidth As Double, _
	scaleHeight As Double, _
	<OutAttribute> ByRef offset As Point _
) As Bitmap
public:
static Bitmap^ Preprocess(
	Bitmap^ image, 
	bool grayscale, 
	bool% edges, 
	bool threshold, 
	double scaleWidth, 
	double scaleHeight, 
	[OutAttribute] Point% offset
)
Parameters
image (Bitmap)
An image.
grayscale (Boolean)
If true and image is not already a grayscale image, converts the image to a grayscale image (see ConvertRgbToGrayscaleImage(Bitmap)).
edges ( Boolean %)
If true, tries to detect object edges in the image (see DetectEdges(Bitmap)). If the image width or height is smaller than 3 pixels, no edge detection will be performed and this parameter will be false when the method returns.
threshold (Boolean)
If true, a threshold (128) is applied to the image (see Threshold(Bitmap, Byte)).
scaleWidth (Double)
If not equal to 1.0, the width of the image will be scaled using the specified factor (see Resize(Bitmap, Double, Double)).
scaleHeight (Double)
If not equal to 1.0, the height of the image will be scaled using the specified factor (see Resize(Bitmap, Double, Double)).
offset ( Point %)
When this method returns, contains a point that specifies the number of pixels the image has been cropped. Cropping takes place to remove a margin that comes from applying an edge detection filter on the image.
Return Value
The preprocessed image.
Exceptions
ExceptionCondition
ArgumentNullExceptionIf image is null.
ArgumentExceptionIf the input image is not a grayscale image, needs to be converted to such, 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: 4.0.3.22982 (4.0.3.22982)