PointF.Equality(PointF, PointF) Operador

Definición

Compara dos PointF estructuras. El resultado especifica si los valores de las X propiedades y Y de las dos PointF estructuras son iguales.

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

que PointF se va a comparar.

right
PointF

que PointF se va a comparar.

Devoluciones

true es si los X valores y Y de las estructuras izquierda y derecha PointF son iguales; de lo contrario, falsees .

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el Equality operador . Para ejecutar este ejemplo, pegue el código siguiente en un formulario Windows. Controle el evento del Paint formulario y llame a opAdditionExample, pasando 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

Se aplica a