## Definizione

Converte un elemento PointF dato in base alle dimensioni specificate.Translates a given PointF by the specified size.

 Add(PointF, Size) Add(PointF, Size) Add(PointF, Size) Add(PointF, Size) Converte un elemento PointF dato in base all'elemento Size specificato.Translates a given PointF by the specified Size. Add(PointF, SizeF) Add(PointF, SizeF) Add(PointF, SizeF) Add(PointF, SizeF) Converte un elemento PointF dato in base a un elemento SizeF specificato.Translates a given PointF by a specified SizeF.

Converte un elemento PointF dato in base all'elemento Size specificato.Translates a given PointF by the specified Size.

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

#### Parametri

pt
PointF PointF PointF PointF

PointF da convertire.The PointF to translate.

sz
Size Size Size Size

Struttura Size che specifica i numeri da aggiungere alle coordinate di `pt`.The Size that specifies the numbers to add to the coordinates of `pt`.

#### Restituisce

Elemento PointF convertito.The translated PointF.

### Commenti

Il Add metodo aggiunge il Width della dimensione specificata per la coordinata x del PointF e il Height per la coordinata y del PointF.The Add method adds the Width of the specified size to the x-coordinate of the PointF and the Height to the y-coordinate of the PointF.

Vedi anche

Converte un elemento PointF dato in base a un elemento SizeF specificato.Translates a given PointF by a specified SizeF.

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

#### Parametri

pt
PointF PointF PointF PointF

PointF da convertire.The PointF to translate.

sz
SizeF SizeF SizeF SizeF

Struttura SizeF che specifica i numeri da aggiungere alle coordinate di `pt`.The SizeF that specifies the numbers to add to the coordinates of `pt`.

#### Restituisce

Elemento PointF convertito.The translated PointF.

### Esempi

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare il metodo Add.The following code example demonstrates how to use the Add method. Per eseguire questo esempio, incollare il codice seguente in un modulo di Windows.To run this example, paste the following code into a Windows Form. Handle del modulo Paint eventi e chiamate `AddExample`, passando `e` come PaintEventArgs.Handle the form's Paint event and call `AddExample`, passing `e` as PaintEventArgs.

``````private void AddExample(PaintEventArgs e)
{
PointF point1 = new PointF(120.5F, 120F);
SizeF size1 = new SizeF(20.5F, 20.5F);
RectangleF rect1 = new RectangleF(point1, size1);
PointF point2 = new PointF(rect1.Right, rect1.Bottom);
e.Graphics.DrawString("They are not equal", this.Font, Brushes.Red, rect1);
else
e.Graphics.DrawString("They are equal", this.Font, Brushes.Black, rect1);

}
``````
``````Private Sub AddExample(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)
Dim point2 As New PointF(rect1.Right, rect1.Bottom)
If point2 <> PointF.Add(point1, size1) Then
e.Graphics.DrawString("They are not equal", Me.Font, Brushes.Red, rect1)
Else
e.Graphics.DrawString("They are equal", Me.Font, Brushes.Black, rect1)
End If

End Sub
``````

### Commenti

Il Add metodo aggiunge il Width della dimensione specificata per la coordinata x del PointF e il Height per la coordinata y del PointF.The Add method adds the Width of the specified size to the x-coordinate of the PointF and the Height to the y-coordinate of the PointF.

Vedi anche