Point.Add(Point, Size) Método

Definição

Adiciona o Size especificado no 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

O Point a ser adicionado.The Point to add.

sz
Size

O Size a ser adicionadoThe Size to add

Retornos

Point

O Point que é o resultado da operação de adição.The Point that is the result of the addition operation.

Exemplos

O exemplo a seguir mostra como usar o método Add.The following example shows how to use the Add method. Para executar este exemplo, Cole-o em um Windows Form.To run this example, paste it into a Windows Form. Manipule o evento do formulário Paint e chame o AddPoint método do Paint método de manipulação de eventos, passando 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

Comentários

O Add adiciona o Width e Height do especificado Size aos X Y valores e do ponto especificado.The Add adds the Width and Height of the specified Size to the X and Y values of the specified point.

Aplica-se a