共用方式為


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

參數

  • actualImage
    類型:Image

    實際影像。

  • expectedImage
    類型:Image

    預期的影像。

  • rectangleList
    類型:List<ToleranceRectangle>

    容限矩形的清單,表示比較的區域和容限值。

傳回值

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

.NET Framework 安全性

請參閱

參考

ImageComparer 類別

Compare 多載

Microsoft.VisualStudio.TestTools.UITesting 命名空間