drawLine

abstract fun drawLine(paint: Paint, x1: Float, y1: Float, x2: Float, y2: Float, stroke: Stroke = DrawStyle.DefaultStroke.stroke, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1.0f)

Draws a straight line between (x1, y1) and (x2, y2).

Parameters

paint

the paint or color used to render the line.

x1

horizontal start coordinate.

y1

vertical start coordinate.

x2

horizontal end coordinate.

y2

vertical end coordinate.

stroke

the Stroke used to outline the line.

alpha

the opacity to render with, from 0.0f (transparent) to 1.0f (opaque).