Properties
| Name | Type | Description |
|---|---|---|
| path | SkPath or string | Path to draw. Can be an SVG path string or a path object |
| start | number | Trims the start of the path. Range: [0, 1] (default: 0) |
| end | number | Trims the end of the path. Range: [0, 1] (default: 1) |
| stroke | StrokeOptions | Converts the path into its filled equivalent |
Using SVG Notation
You can use SVG path notation directly:Using Path Object
Create paths programmatically using the Skia Path API:Trim
You can trim the path usingstart and end properties:
Fill Type
ThefillType property defines the algorithm to determine the inside of a shape. Possible values:
winding(default)evenOddinverseWindinginverseEvenOdd
Path Commands
When using the Path API programmatically, you have access to many commands:moveTo(x, y)- Move to a pointlineTo(x, y)- Draw a line to a pointcubicTo(x1, y1, x2, y2, x3, y3)- Draw a cubic bezier curvequadTo(x1, y1, x2, y2)- Draw a quadratic bezier curvearcTo(rx, ry, xAxisRotate, useSmallArc, sweep, x, y)- Draw an arcclose()- Close the current contouraddCircle(x, y, r)- Add a circleaddRect(rect)- Add a rectangleaddRRect(rrect)- Add a rounded rectangle
Related
- Path Effects - Apply effects to paths
- Path API - Complete Path API reference
- Path Hooks - Animate paths