Method DrawDashedLine
DrawDashedLine(SKCanvas, SKPoint, SKPoint, SKColor, float, SkiaDashStyle, float[]?, float, bool)
Draws a line on the canvas using a dash style similar to System.Drawing.Pen.DashStyle. This helper creates and configures an SKPaint internally (caller does not own/dispose it).
public static void DrawDashedLine(SKCanvas canvas, SKPoint p1, SKPoint p2, SKColor color, float strokeWidth = 1, SkiaDashStyle dashStyle = SkiaDashStyle.Solid, float[]? customPattern = null, float dashOffset = 0, bool antialiasing = true)
Parameters
canvasSKCanvasCanvas to draw on (not null).
p1SKPointStart point in canvas coordinates.
p2SKPointEnd point in canvas coordinates.
colorSKColorStroke color.
strokeWidthfloatStroke width in canvas units (use 0 for hairline).
dashStyleSkiaDashStyleDash style from System.Drawing.Drawing2D.DashStyle.
customPatternfloat[]If dashStyle == DashStyle.Custom, this supplies the pattern as device pixels: {on, off, on, off, ...}. If null when Custom is requested, falls back to a dotted pattern.
dashOffsetfloatPhase/offset in device pixels. This is converted to canvas units using the canvas transform so animation/phase matches device-space expectations.
antialiasingboolWhether to enable antialiasing on the paint.