ClosePath()

Syntaxe

ClosePath()
Description
Ferme la figure courante dans le chemin de dessin vectoriel en ajoutant une ligne droite vers le point de départ de la figure.

Arguments

Aucun.

Valeur de retour

Aucune.

Remarques

Le point de départ est l'emplacement du dernier appel à MovePathCursor().

Lorsqu'un chemin est rempli, seules les figures fermées sont prise en compte.

Exemple

  If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CanvasGadget(0, 0, 0, 400, 200)

    If StartVectorDrawing(CanvasVectorOutput(0))
    
      ; Crée un chemin avec deux triangles fermés
      MovePathCursor(20, 160)
      AddPathLine(100, 20)
      AddPathLine(180, 160)
      ClosePath()
      
      MovePathCursor(220, 160)
      AddPathLine(300, 20)
      AddPathLine(380, 160)
      ClosePath()      

      ; remplir le chemin
      VectorSourceColor(RGBA(0, 0, 255, 255))
      FillPath()
    
      StopVectorDrawing()
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf

Voir aussi

FillPath(), IsInsidePath(), MovePathCursor(), AddPathLine()

OS Supportés

Tous

<- ClipPath() - VectorDrawing Index - ConvertCoordinateX() ->