CustomDashPath()

Syntax

CustomDashPath(Width.d, Array.d() [, Flags [, StartOffset.d]])
Description
Draw the current drawing path with a custom dashing pattern.

By default, the path is reset after calling this function. This can be prevented with the appropriate flags.

Parameters

Width.d Specifies the width for the dashed line.
Array.d() Specifies the length of each dash and each space to the next dash. The array must have an even number of entries. When the drawing operation reaches the end of the array, the pattern is repeated. A dash length of 0 will draw a single dot.
Flags (optional) Specifies optional characteristics for the drawn dashes. This can be a combination of the following values:
  #PB_Path_Default       : No special behavior (default value)
  #PB_Path_Preserve      : Don't reset the path after this function
  #PB_Path_RoundEnd      : Draw the dashes with a rounded ends
  #PB_Path_SquareEnd     : Draw the dashes with a square box at the ends
  #PB_Path_RoundCorner   : Draw the dashes with rounded corners
  #PB_Path_DiagonalCorner: Draw the dashes with diagonally cut corners
StartOffset.d (optional) Specifies the distance to skip within the dash pattern before starting to draw the path. The default value is 0.

Return value

None.

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
      
      VectorSourceColor(RGBA(255, 0, 0, 255))
      
      Dim dashes.d(7)
      dashes(0) = 20
      dashes(1) = 10
      dashes(2) = 0 ; draw a dot
      dashes(3) = 10
      dashes(4) = 0
      dashes(5) = 10
      dashes(6) = 20
      dashes(7) = 10
      CustomDashPath(5, dashes())
    
      StopVectorDrawing()
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf

See Also

FillPath(), StrokePath(), DotPath(), DashPath(), IsInsideStroke(), ResetPath()

Supported OS

All

<- ConvertCoordinateY() - VectorDrawing Index - DashPath() ->