GraphicsPath.GetLastPoint Method
Definition
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
Returns
A PointF that represents the last point in this GraphicsPath.
Examples
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 )
{
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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET