Point.Subtraction(Point, Size) Point.Subtraction(Point, Size) Point.Subtraction(Point, Size) Point.Subtraction(Point, Size) Operator

Definición

Convierte una estructura Point según el valor negativo del Size especificado.Translates a Point by the negative of a given Size.

public:
 static System::Drawing::Point operator -(System::Drawing::Point pt, System::Drawing::Size sz);
public static System.Drawing.Point operator - (System.Drawing.Point pt, System.Drawing.Size sz);
static member ( - ) : System.Drawing.Point * System.Drawing.Size -> System.Drawing.Point
Public Shared Operator - (pt As Point, sz As Size) As Point

Parámetros

pt
Point Point Point Point

Point que se va a convertir.The Point to translate.

sz
Size Size Size Size

Size que especifica el par de números que se va a restar a las coordenadas de pt.A Size that specifies the pair of numbers to subtract from the coordinates of pt.

Devoluciones

Estructura Point que se convierte según el valor negativo de una determinada estructura Size.A Point structure that is translated by the negative of a given Size structure.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el PointConverter y Subtraction operador.The following code example demonstrates how to use the PointConverter and the Subtraction operator. En este ejemplo está diseñado para usarse con Windows Forms.This example is designed to be used with Windows Forms. Pegue este código en un formulario y llame a la ShowPointConverter método cuando el control del formulario Paint evento pasando e como PaintEventArgs.Paste this code into a form and call the ShowPointConverter method when handling the form's Paint event, passing e as PaintEventArgs.

void ShowPointConverter( PaintEventArgs^ e )
{
   // Create the PointConverter.
   System::ComponentModel::TypeConverter^ converter = System::ComponentModel::TypeDescriptor::GetConverter( Point::typeid );
   Point point1 =  *dynamic_cast<Point^>(converter->ConvertFromString( "200, 200" ));

   // Use the subtraction operator to get a second point.
   Point point2 = point1 - System::Drawing::Size( 190, 190 );

   // Draw a line between the two points.
   e->Graphics->DrawLine( Pens::Black, point1, point2 );
}
private void ShowPointConverter(PaintEventArgs e)
{

    // Create the PointConverter.
    System.ComponentModel.TypeConverter converter = 
        System.ComponentModel.TypeDescriptor.GetConverter(typeof(Point));

    Point point1 = (Point) converter.ConvertFromString("200, 200");

    // Use the subtraction operator to get a second point.
    Point point2 = point1 - new Size(190, 190);

    // Draw a line between the two points.
    e.Graphics.DrawLine(Pens.Black, point1, point2);
}
Private Sub ShowPointConverter(ByVal e As PaintEventArgs)

    ' Create the PointConverter.
    Dim converter As System.ComponentModel.TypeConverter = _
        System.ComponentModel.TypeDescriptor.GetConverter(GetType(Point))

    Dim point1 As Point = _
        CType(converter.ConvertFromString("200, 200"), Point)

    ' Use the subtraction operator to get a second point.
    Dim point2 As Point = Point.op_Subtraction(point1, _
        New Size(190, 190))

    ' Draw a line between the two points.
    e.Graphics.DrawLine(Pens.Black, point1, point2)
End Sub

Se aplica a