PathSegments()

Syntax

Result$ = PathSegments()
Description
Returns a string description of the current vector drawing path. The result can be used to examine the current path or in the AddPathSegments() command to reproduce the same path later.

Parameters

None.

Return value

The returned string contains one letter commands followed by the appropriate number of coordinate parameters. Each value is separated by a single space. All coordinates are absolute.
  M x y                MovePathCursor()
  L x y                AddPathLine()
  C x1 y1 x2 y2 x3 y3  AddPathCurve()
  Z                    ClosePath()
There are no string representations for commands like AddPathCircle() or AddPathEllipse(), as their results are internally converted to curves by the vector drawing library.

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))
      
      MovePathCursor(40, 20)
      For i = 1 To 4
        AddPathLine(80, 0, #PB_Path_Relative)
        AddPathLine(0, 40, #PB_Path_Relative)
      Next i
      
      ; Show the path segments
      Debug PathSegments()
      
      VectorSourceColor(RGBA(255, 0, 0, 255))
      StrokePath(10, #PB_Path_RoundCorner)
    
      StopVectorDrawing()
    EndIf
  EndIf

See Also

AddPathSegments()

Supported OS

All

<- PathPointY() - VectorDrawing Index - ResetCoordinates() ->