GraphicsPath.GetLastPoint Método

Definición

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

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

Devoluciones

Un PointF que representa el último punto de este trazado GraphicsPath.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, un OnPaint objeto de evento. 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 == false )
      {
         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 == false)
    {
        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