Click or drag to resize
Ranorex

ImagingCompare Method (Element, Bitmap, ImagingFindOptions)

Compares the specified feature with (a screenshot of) the element and returns whether their similarity is greater than or equal to the value specified by options.Similarity.

Namespace:  Ranorex
Assembly:  Ranorex.Core (in Ranorex.Core.dll) Version: 12.7.4-git.38314c06
Syntax
public static bool Compare(
	Element element,
	Bitmap feature,
	ImagingFindOptions options
)

Parameters

element
Type: Ranorex.CoreElement
The element to make a screenshot of.
feature
Type: System.DrawingBitmap
The image to compare the screenshot with.
options
Type: RanorexImagingFindOptions
The options for the image comparison. The Preprocessing options are applied to both images, the Clipping rectangle only to the screenshot of the element. The Similarity defines the minimum similarity the images need to have.

Return Value

Type: Boolean
True if the similarity of the two (preprocessed) images is greater than or equal to options.Similarity.
Exceptions
ExceptionCondition
RanorexExceptionIf capturing a screenshot of the element fails.
ArgumentNullExceptionIf element is null.
ArgumentNullExceptionIf feature is null.
ArgumentExceptionIf the bitmap format of the feature cannot be converted to that of the screenshot of the element.
Remarks
False will be returned if the feature and the screenshot of the element (after clipping using the rectangle value of options.Clipping) do not have the same size.
See Also