Code: Select all
Procedure RoundedBox(x, y, width, height, radius)
MovePathCursor(x, y + radius)
AddPathArc(x, y + height, x + radius, y + height, radius)
AddPathArc(x + width, y + height, x + width, y + height-radius, radius)
AddPathArc(x + width, y, x + width - radius, y, radius)
AddPathArc(x, y, x, y + radius, radius)
VectorSourceColor(RGBA(255, 0, 0, 255))
StrokePath(3)
EndProcedure
If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 200)
If StartVectorDrawing(CanvasVectorOutput(0))
RoundedBox(10, 10, 200, 100, 20)
StopVectorDrawing()
EndIf
EndIf