Click or drag to resize
Ranorex

ValidateCompareImage Method (Bitmap, Bitmap, ImagingFindOptions, String, ValidateOptions)

Compares two images to validate if they match within specified tolerance.

Namespace:  Ranorex
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
public static bool CompareImage(
	Bitmap expected,
	Bitmap current,
	ImagingFindOptions findOptions,
	string message,
	ValidateOptions options
)

Parameters

expected
Type: System.DrawingBitmap
The reference image to compare against.
current
Type: System.DrawingBitmap
The image to validate against the reference.
findOptions
Type: RanorexImagingFindOptions
A ImagingFindOptions instance that defines the options for the comparison.
message
Type: SystemString
The message to log. "{0}" is replaced by the string representation of the expected.
options
Type: RanorexValidateOptions
Additional ValidateOptions for this validation action.

Return Value

Type: Boolean
True if the specified current matches the screenshot of the expected; otherwise false.
Exceptions
ExceptionCondition
ArgumentNullExceptionIf current is null.
ValidationExceptionIf the validation fails and options.ExceptionOnFail is true.
See Also