Compares specific regions of two images by the area specified by tolerance rectangles.
Returns true if the image difference is within tolerance.
Namespace:  Microsoft.VisualStudio.TestTools.UITesting
Assembly:  Microsoft.VisualStudio.TestTools.UITesting (in Microsoft.VisualStudio.TestTools.UITesting.dll)
Syntax
'Declaration
Public Shared Function Compare ( _
    actualImage As Image, _
    expectedImage As Image, _
    rectangleList As List(Of ToleranceRectangle) _
) As Boolean
public static bool Compare(
    Image actualImage,
    Image expectedImage,
    List<ToleranceRectangle> rectangleList
)
public:
static bool Compare(
    Image^ actualImage, 
    Image^ expectedImage, 
    List<ToleranceRectangle>^ rectangleList
)
static member Compare : 
        actualImage:Image * 
        expectedImage:Image * 
        rectangleList:List<ToleranceRectangle> -> bool
public static function Compare(
    actualImage : Image, 
    expectedImage : Image, 
    rectangleList : List<ToleranceRectangle>
) : boolean
Parameters
- actualImage 
 Type: Image- Actual image. 
- expectedImage 
 Type: Image- Expected image. 
- rectangleList 
 Type: List<ToleranceRectangle>- List of tolerance rectangles indicating area to compare and tolerance value. 
Return Value
Type: Boolean
True if the two images meet to values specified in tolerance rectangles.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.