GraphicsPath.GetLastPoint Método

Definición

Obtiene el último punto de la PathPoints matriz de este GraphicsPath.

public:
 System::Drawing::PointF GetLastPoint();
public System.Drawing.PointF GetLastPoint();
member this.GetLastPoint : unit -> System.Drawing.PointF
Public Function GetLastPoint () As PointF

Devoluciones

que PointF representa el último punto de este GraphicsPathobjeto .

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, un objeto de evento OnPaint. El código crea una ruta de acceso, agrega una línea a la ruta de acceso y, a continuación, obtiene el último punto de la ruta de acceso.

private:
   void GetLastPointExample( PaintEventArgs^ /*e*/ )
   {
      GraphicsPath^ myPath = gcnew GraphicsPath;
      myPath->AddLine( 20, 20, 100, 20 );
      PointF lastPoint = myPath->GetLastPoint();
      if ( !lastPoint.IsEmpty )
      {
         String^ lastPointXString = lastPoint.X.ToString();
         String^ lastPointYString = lastPoint.Y.ToString();
         MessageBox::Show( String::Concat( lastPointXString, ", ", lastPointYString ) );
      }
      else
            MessageBox::Show( "lastPoint is empty" );
   }
private void GetLastPointExample(PaintEventArgs e)
{
    GraphicsPath myPath = new GraphicsPath();
    myPath.AddLine(20, 20, 100, 20);
    PointF lastPoint = myPath.GetLastPoint();
    if(!lastPoint.IsEmpty)
    {
        string lastPointXString = lastPoint.X.ToString();
        string lastPointYString = lastPoint.Y.ToString();
        MessageBox.Show(lastPointXString + ", " + lastPointYString);
    }
    else
    {
        MessageBox.Show("lastPoint is empty");
    }
}
Public Sub GetLastPointExample(ByVal e As PaintEventArgs)
    Dim myPath As New GraphicsPath
    myPath.AddLine(20, 20, 100, 20)
    Dim lastPoint As PointF = myPath.GetLastPoint()
    If lastPoint.IsEmpty = False Then
        Dim lastPointXString As String = lastPoint.X.ToString()
        Dim lastPointYString As String = lastPoint.Y.ToString()
        MessageBox.Show((lastPointXString + ", " + lastPointYString))
    Else
        MessageBox.Show("lastPoint is empty")
    End If
End Sub

Se aplica a