the API documentation (Ranorex 22.214.171.12470) of Namespaces ► Ranorex ► Imaging ► Compare(Element, Bitmap, Imaging..::.FindOptions)
says (interesting parts highlighted):
So according to the first highlighted line, the clipping is done to the image.public static bool Compare(
The element to make a screenshot of.
The image to compare the screenshot with.
The options for the image comparison. The Preprocessing are applied to both images, the Clipping rectangle only to image. The Similarity defines the minimum similarity the images need to have.
True if the similarity of the two (preprocessed) images is greater than or equal to options.Similarity.
Falsewill be returned if the two images (after clipping image using the rectangle value of options.Clipping) do not have the same size.
Falsewill be returned if the image and the screenshot of the element (after clipping using the rectangle value of options.Clipping) do not have the same size.
According to the second line, it is not distinct. I'd say it means clipping is done to the screenshot of the element.
Also, the API documentation of Namespaces ► Ranorex ► Imaging..::.FindOptions ► Clipping
That would be the element in case of Imaging.Compare, which is opposite to the first highlighted line.Remarks
The clipping rectangle will always be applied to the first argument of a method, i.e. for the FindSingle(Bitmap, Bitmap) method the value of this property is only applied to the image argument.
UseCase behind this:
I have a custom-painted toolbar. I try to verify the enabled/disabled state of a button on this toolbar.
When working with the Recorder, the Image validation offers to check if a sub-part of an image (in my case a toolbar button) is contained in the whole screenshot of an element (in my case the whole toolbar). That's what I try to get with coding. Yet to no success.
Can you pleace shed some light on how to do this?