RanorexRanorex Documentation
Compare Method (element, feature, options)
NamespacesRanorexImagingCompare(Element, Bitmap, Imaging..::.FindOptions)
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.
Declaration Syntax
C#Visual BasicVisual C++
public static bool Compare(
	Element element,
	Bitmap feature,
	Imaging..::.FindOptions options
)
Public Shared Function Compare ( _
	element As Element, _
	feature As Bitmap, _
	options As Imaging..::.FindOptions _
) As Boolean
public:
static bool Compare(
	Element^ element, 
	Bitmap^ feature, 
	Imaging..::.FindOptions^ options
)
Parameters
element (Element)
The element to make a screenshot of.
feature (Bitmap)
The image to compare the screenshot with.
options (Imaging..::.FindOptions)
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
True if the similarity of the two (preprocessed) images is greater than or equal to options.Similarity.
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.
Exceptions
ExceptionCondition
RanorexExceptionIf capturing a screenshot of the element fails.
ArgumentNullExceptionIf element is null.
ArgumentNullExceptionIf feature is null.
ArgumentExceptionIf the bitmap format of the image cannot be converted to that (color image, Format24bppRgb) of the screenshot of the element.

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