Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pen

Describes how lines are stroked.

Hierarchy

  • Pen

Implements

Index

Constructors

constructor

  • Initializes a new instance of the Pen class.

    Parameters

    • brush: Brush

      The brush.

    • thickness: number

      The thickness.

    • startCap: LineCap

      The start cap.

    • endCap: LineCap

      The end cap.

    • lineJoin: LineJoin

      The line join.

    • dashStyle: number[]

      The dash style.

    • dashOffset: number

      The dash offset.

    • dashCap: LineCap

      The dash cap.

    Returns Pen

Properties

brush

brush: Brush

Gets or sets the brush that is used to fill the outline procuded by the pen.

dashCap

dashCap: LineCap

Gets or sets the geometry added at the beginning and end of each dash.

dashOffset

dashOffset: number

Gets or sets the offset of the first dash. The stroke is solid to the specified offset. The specified offset is multiplied with the pens thickness, just like the dash style. Be aware that a positive offset will move the dashes against stroke direction.

dashStyle

dashStyle: number[]

Gets or sets the definition of the dashes used to render the stroke. The default value is empty, which will render one solid line. The length of the dashes and gaps specified here are multiplied with the thickness of the pen when it is drawn. So in case you want dashes with a length of one millimeter on a pen with 0.1 mm thickness, you must specify a dash of length 10 here.

endCap

endCap: LineCap

Gets or sets the geometry added to the end of the stroke.

lineJoin

lineJoin: LineJoin

Gets or sets the geometry added between to segments of the stroke.

startCap

startCap: LineCap

Gets or sets the geometry added to the beginning of the stroke.

thickness

thickness: number

Gets or sets the thickness of stroke that is produced by the pen (in millimeters).

Methods

Private serialize

  • serialize(target: BufferWriter): void
  • Parameters

    • target: BufferWriter

    Returns void

Static create

  • Returns the pen that is defined by the specified description.

    Parameters

    Returns Pen

Generated using TypeDoc