DrawStyle that provides information for drawing content with a stroke

Summary

Constants

const Float

Default miter length used in combination with joins

Cmn
const Float

Width to indicate a hairline stroke of 1 pixel

Cmn

Public companion properties

StrokeCap

Default cap used for line endings

Cmn
StrokeJoin

Default join style used for connections between line and curve segments

Cmn

Public constructors

Stroke(
    width: Float,
    miter: Float,
    cap: StrokeCap,
    join: StrokeJoin,
    pathEffect: PathEffect?
)
Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

StrokeCap

Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated.

Cmn
StrokeJoin

Set's the treatment where lines and curve segments join on a stroked path.

Cmn
Float

Set the stroke miter value.

Cmn
PathEffect?

Effect to apply to the stroke, null indicates a solid stroke line is to be drawn

Cmn
Float

Configure the width of the stroke in pixels

Cmn

Constants

DefaultMiter

const val DefaultMiter = 4.0f: Float

Default miter length used in combination with joins

HairlineWidth

const val HairlineWidth = 0.0f: Float

Width to indicate a hairline stroke of 1 pixel

Public companion properties

DefaultCap

val DefaultCapStrokeCap

Default cap used for line endings

DefaultJoin

val DefaultJoinStrokeJoin

Default join style used for connections between line and curve segments

Public constructors

Stroke

Stroke(
    width: Float = 0.0f,
    miter: Float = DefaultMiter,
    cap: StrokeCap = DefaultCap,
    join: StrokeJoin = DefaultJoin,
    pathEffect: PathEffect? = null
)
Parameters
width: Float = 0.0f

Configure the width of the stroke in pixels

miter: Float = DefaultMiter

Set the stroke miter value. This is used to control the behavior of miter joins when the joins angle is sharp. This value must be >= 0

cap: StrokeCap = DefaultCap

Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated. The default is StrokeCap.Butt

join: StrokeJoin = DefaultJoin

Set's the treatment where lines and curve segments join on a stroked path. The default is StrokeJoin.Miter

pathEffect: PathEffect? = null

Effect to apply to the stroke, null indicates a solid stroke line is to be drawn

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

cap

val capStrokeCap

Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated. The default is StrokeCap.Butt

join

val joinStrokeJoin

Set's the treatment where lines and curve segments join on a stroked path. The default is StrokeJoin.Miter

miter

val miterFloat

Set the stroke miter value. This is used to control the behavior of miter joins when the joins angle is sharp. This value must be >= 0

pathEffect

val pathEffectPathEffect?

Effect to apply to the stroke, null indicates a solid stroke line is to be drawn

width

val widthFloat

Configure the width of the stroke in pixels