PathLength()
Syntax
Result.d = PathLength()Description
Returns the total length of the current vector drawing path.
Parameters
None.
Return value
Returns the length of the current path.
Example
If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 200)
If StartVectorDrawing(CanvasVectorOutput(0))
; construct path
MovePathCursor(150, 125)
AddPathCurve(0, 270, 0, -150, 350, 180)
; get length
Debug "Path length: " + PathLength()
; stroke the path
VectorSourceColor($FF0000FF)
StrokePath(5)
StopVectorDrawing()
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
See Also
PathPointX(), PathPointY(), PathPointAngle()
Supported OS
All