GraphicsPath.GetLastPoint Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient le dernier point du tableau PathPoints de ce GraphicsPath.
public:
System::Drawing::PointF GetLastPoint();
public System.Drawing.PointF GetLastPoint ();
member this.GetLastPoint : unit -> System.Drawing.PointF
Public Function GetLastPoint () As PointF
Retours
PointF qui représente le dernier point de ce GraphicsPath.
Exemples
L’exemple de code suivant est conçu pour être utilisé avec Windows Forms et nécessite PaintEventArgse
, un objet d’événementOnPaint. Le code crée un chemin, ajoute une ligne au chemin, puis obtient le dernier point du chemin.
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
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour