PointF.Equality(PointF, PointF) Operador

Definição

Compara duas estruturas PointF. O resultado especifica se os valores das propriedades X e Y das duas estruturas PointF são iguais.

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 ( = ) : System.Drawing.PointF * System.Drawing.PointF -> bool
Public Shared Operator == (left As PointF, right As PointF) As Boolean

Parâmetros

left
PointF

Um PointF para comparar.

right
PointF

Um PointF para comparar.

Retornos

true se os valores de X e Y das estruturas PointF esquerda e direita forem iguais; caso contrário, false.

Exemplos

O exemplo de código a seguir demonstra como usar o Equality operador . Para executar este exemplo, cole o código a seguir em um Windows Form. Manipule o evento do Paint formulário e chame opAdditionExample, passando e como PaintEventArgs.

private void OpAdditionExample(PaintEventArgs e)
{
    PointF point1 = new PointF(120.5F, 120F);
    SizeF size1 = new SizeF(120.5F, 30.5F);
    RectangleF rect1 = new RectangleF(point1, size1);
    if (new PointF(rect1.Right, rect1.Bottom) == point1 + size1)
        e.Graphics.DrawString("They are equal", this.Font, Brushes.Black, rect1);
    else
        e.Graphics.DrawString("They are not equal", this.Font, Brushes.Red, rect1);
}
Private Sub OpAdditionExample(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)
    If New PointF(rect1.Right, rect1.Bottom) = point1 + size1 Then
        e.Graphics.DrawString("They are equal", Me.Font, Brushes.Black, rect1)
    Else
        e.Graphics.DrawString("They are not equal", Me.Font, Brushes.Red, rect1)
    End If
 
End Sub

Aplica-se a