Why does the SetValue method of GraphicsPath.PathPoints appear to have no effect? e.g.:
And, in a similar vein, can I not just add a point to the end of a GraphicsPath without having to resort to a procedure like this:
?
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim h As New Drawing.Drawing2D.GraphicsPath
h.AddLine(New PointF(0, 0), New PointF(10, 10))
Debug.Print("Before" & vbTab & h.PathPoints(1).ToString)
h.PathPoints.SetValue(New PointF(20, 20), 1)
Debug.Print("After" & vbTab & h.PathPoints(1).ToString) remains 10,10
End Sub
End Class
And, in a similar vein, can I not just add a point to the end of a GraphicsPath without having to resort to a procedure like this:
Code:
Protected Shared Sub ExtendPath(ByRef P As Drawing2D.GraphicsPath, ByVal PNew As PointF)
I just want to add a point at the end of the path, but it seems I always have to add a line.
If P.PathPoints.Length > 0 Then
P.AddLine(P.PathPoints(P.PathPoints.Length - 1), PNew)
End If
End Sub
Last edited by a moderator: