共用方式為


ImageComparer.Compare 方法 (Image, Image, List<ToleranceRectangle>)

由指定矩形指定區域比較兩個影像的特定區域。

如果影像區別容許誤差內,則傳回 true。

命名空間:  Microsoft.VisualStudio.TestTools.UITesting
組件:  Microsoft.VisualStudio.TestTools.UITesting (在 Microsoft.VisualStudio.TestTools.UITesting.dll 中)

語法

'宣告
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

參數

傳回值

型別:System.Boolean
如果這兩個影像符合容限矩形中所指定的值,則為 true。

.NET Framework 安全性

請參閱

參考

ImageComparer 類別

Compare 多載

Microsoft.VisualStudio.TestTools.UITesting 命名空間