GraphicsPath.GetLastPoint Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the last point in the PathPoints array of this GraphicsPath.
public:
System::Drawing::PointF GetLastPoint();
public System.Drawing.PointF GetLastPoint ();
member this.GetLastPoint : unit -> System.Drawing.PointF
Public Function GetLastPoint () As PointF
A PointF that represents the last point in this GraphicsPath.
The following code example is designed for use with Windows Forms, and it requires PaintEventArgs e
, an OnPaint event object. The code creates a path, adds a line to the path, and then gets the last point in the path.
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
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: