Rect.Equals 메서드

정의

두 사각형이 서로 같은지 여부를 나타냅니다.

오버로드

Equals(Rect, Rect)

지정된 사각형이 서로 같은지 여부를 나타냅니다.

Equals(Object)

지정된 개체가 현재 사각형과 같은지 여부를 나타냅니다.

Equals(Rect)

지정된 사각형이 현재 사각형과 같은지 여부를 나타냅니다.

Equals(Rect, Rect)

지정된 사각형이 서로 같은지 여부를 나타냅니다.

public:
 static bool Equals(System::Windows::Rect rect1, System::Windows::Rect rect2);
public static bool Equals (System.Windows.Rect rect1, System.Windows.Rect rect2);
static member Equals : System.Windows.Rect * System.Windows.Rect -> bool
Public Shared Function Equals (rect1 As Rect, rect2 As Rect) As Boolean

매개 변수

rect1
Rect

비교할 첫 번째 사각형입니다.

rect2
Rect

비교할 두 번째 사각형입니다.

반환

사각형의 LocationSize 값이 서로 같으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 사용 하는 방법의 Equals(Rect, Rect) 하나의 사각형만 다른 같은지 여부를 결정 하는 방법입니다.

private bool rectEqualsExample2()
{
    // Create a rectangle.
    Rect myRectangle1 = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle1.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle1.Size = new Size(200, 50);

    // Create second rectangle to compare to the first.
    Rect myRectangle2 = new Rect();
    myRectangle2.Location = new Point(10, 5);
    myRectangle2.Size = new Size(200, 50);

    // Using the Equals method, see if the second rectangle is 
    // the same as the first rectangle. doesEqual is true because
    // both rectangles are exactly the same in that they both have the 
    // same location and size.
    bool doesEqual = Rect.Equals(myRectangle1, myRectangle2);

    return doesEqual;
}

설명

이 작업 개체 같은지 테스트합니다.

이 비교에서 두 인스턴스의 Double.NaN 것으로 간주 됩니다.

참고

사각형의 위치 및 크기에서 설명한 Double 값입니다. 때문에 Double 값에 연산을 수행 하는 경우 정밀도 떨어질 수, 논리적으로 동일한 두 값 간의 비교 실패할 수 있습니다.

추가 정보

적용 대상

Equals(Object)

지정된 개체가 현재 사각형과 같은지 여부를 나타냅니다.

public:
 override bool Equals(System::Object ^ o);
public override bool Equals (object o);
override this.Equals : obj -> bool
Public Overrides Function Equals (o As Object) As Boolean

매개 변수

o
Object

현재 사각형과 비교할 개체입니다.

반환

oRect이고 LocationSize 값이 현재 사각형과 같으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 사용 하는 방법의 Equals(Object) 사각형을 지정된 된 개체와 같은지 여부를 결정 하는 방법입니다.

private bool rectEqualsExample1()
{
    // Create a rectangle.
    Rect myRectangle1 = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle1.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle1.Size = new Size(200, 50);

    // Create second rectangle to compare to the first.
    Rect myRectangle2 = new Rect();
    myRectangle2.Location = new Point(10, 5);
    myRectangle2.Size = new Size(200, 50);

    // Using the Equals method, see if the second rectangle is the
    // same as the first rectangle. doesEqual is true because both
    // rectangles are exactly the same with respect to location and size. 
    bool doesEqual = myRectangle1.Equals(myRectangle2);

    return doesEqual;
}

설명

이 작업 개체 같은지 테스트합니다.

이 비교에서 두 인스턴스의 Double.NaN 것으로 간주 됩니다.

참고

사각형의 위치 및 크기에서 설명한 Double 값입니다. 때문에 Double 값에 연산을 수행 하는 경우 정밀도 떨어질 수, 논리적으로 동일한 두 값 간의 비교 실패할 수 있습니다.

추가 정보

적용 대상

Equals(Rect)

지정된 사각형이 현재 사각형과 같은지 여부를 나타냅니다.

public:
 bool Equals(System::Windows::Rect value);
public bool Equals (System.Windows.Rect value);
override this.Equals : System.Windows.Rect -> bool
Public Function Equals (value As Rect) As Boolean

매개 변수

value
Rect

현재 사각형과 비교할 사각형입니다.

반환

지정된 사각형의 LocationSize 값이 현재 사각형과 같으면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 사용 하는 방법의 Equals(Rect) 사각형으로 지정 된 사각형와 같은지 여부를 결정 하는 방법입니다.

private bool rectEqualsExample1()
{
    // Create a rectangle.
    Rect myRectangle1 = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle1.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle1.Size = new Size(200, 50);

    // Create second rectangle to compare to the first.
    Rect myRectangle2 = new Rect();
    myRectangle2.Location = new Point(10, 5);
    myRectangle2.Size = new Size(200, 50);

    // Using the Equals method, see if the second rectangle is the
    // same as the first rectangle. doesEqual is true because both
    // rectangles are exactly the same with respect to location and size. 
    bool doesEqual = myRectangle1.Equals(myRectangle2);

    return doesEqual;
}

설명

이 작업 개체 같은지 테스트합니다.

이 비교에서 두 인스턴스의 Double.NaN 것으로 간주 됩니다.

참고

사각형의 위치 및 크기에서 설명한 Double 값입니다. 때문에 Double 값에 연산을 수행 하는 경우 정밀도 떨어질 수, 논리적으로 동일한 두 값 간의 비교 실패할 수 있습니다.

추가 정보

적용 대상