다음을 통해 공유


PointF.Inequality(PointF, PointF) 연산자

정의

지정된 점의 좌표가 같지 않은지 여부를 확인합니다.

public:
 static bool operator !=(System::Drawing::PointF left, System::Drawing::PointF right);
public static bool operator != (System.Drawing.PointF left, System.Drawing.PointF right);
static member op_Inequality : System.Drawing.PointF * System.Drawing.PointF -> bool
Public Shared Operator != (left As PointF, right As PointF) As Boolean

매개 변수

left
PointF

비교할 PointF입니다.

right
PointF

비교할 PointF입니다.

반환

leftrightXY 값이 같지 않으면 true를 반환하고 그렇지 않으면 false를 반환합니다.

예제

다음 코드 예제에서는 연산자를 사용 하는 방법을 보여 줍니다 Inequality . 이 예제를 실행 하려면 Windows 폼에 다음 코드를 붙여 넣습니다. 양식의 Paint 이벤트를 처리하고 를 로 전달 ePaintEventArgs하여 를 호출AddExample합니다.

private void AddExample(PaintEventArgs e)
{
    PointF point1 = new PointF(120.5F, 120F);
    SizeF size1 = new SizeF(20.5F, 20.5F);
    RectangleF rect1 = new RectangleF(point1, size1);
    PointF point2 = new PointF(rect1.Right, rect1.Bottom);
    if (point2 != PointF.Add(point1, size1))
        e.Graphics.DrawString("They are not equal", this.Font, Brushes.Red, rect1);
    else
        e.Graphics.DrawString("They are equal", this.Font, Brushes.Black, rect1);
}
Private Sub AddExample(ByVal e As PaintEventArgs) 
    Dim size1 As New SizeF(120.5F, 30.5F)
    Dim point1 As New PointF(20.5F, 20F)
    Dim rect1 As New RectangleF(point1, size1)
    Dim point2 As New PointF(rect1.Right, rect1.Bottom)
    If point2 <> PointF.Add(point1, size1) Then
        e.Graphics.DrawString("They are not equal", Me.Font, Brushes.Red, rect1)
    Else
        e.Graphics.DrawString("They are equal", Me.Font, Brushes.Black, rect1)
    End If

End Sub

적용 대상