Point.Add(Point, Size) Point.Add(Point, Size) Point.Add(Point, Size) Point.Add(Point, Size) Method

Definición

Agrega el Size especificado al Point especificado.Adds the specified Size to the specified Point.

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

Parámetros

pt
Point Point Point Point

Point que se va a agregar.The Point to add.

sz
Size Size Size Size

Size que se va a sumar.The Size to add

Devoluciones

Objeto Point que es el resultado de la operación de suma.The Point that is the result of the addition operation.

Ejemplos

En el siguiente ejemplo, se muestra cómo utilizar el método Add.The following example shows how to use the Add method. Para ejecutar este ejemplo, péguelo en un formulario de Windows.To run this example, paste it into a Windows Form. Controlar el formato Paint evento y llamar a la AddPoint método desde el Paint método de control de eventos, pasando e como PaintEventArgs.Handle the form's Paint event and call the AddPoint method from the Paint event-handling method, passing e as PaintEventArgs.

private void AddPoint(PaintEventArgs e)
{
    Point point1 = new Point(10, 10);
    Point point2 = Point.Add(point1, new Size(250,0));
    e.Graphics.DrawLine(Pens.Red, point1, point2);
}
Private Sub AddPoint(ByVal e As PaintEventArgs) 
    Dim point1 As New Point(10, 10)
    Dim point2 As Point = Point.Add(point1, New Size(250, 0))
    e.Graphics.DrawLine(Pens.Red, point1, point2)

End Sub

Comentarios

El Add agrega el Width y Height del elemento especificado Size a la X y Y valores del punto especificado.The Add adds the Width and Height of the specified Size to the X and Y values of the specified point.

Se aplica a