Skip to main content

Class: StrokeRenderer

(abstract) Rendering.StrokeRenderer(canvas, optionsopt)

Stroke painter

Constructor

(abstract) new StrokeRenderer(canvas, optionsopt)

Parameters:
NameTypeAttributesDescription
canvasRendering.InkCanvasView layer
optionsSize|Rendering.WebGL.InkLayerOptions<optional>When not available underlying layer is auto created with default size (device screen size).
Properties:
NameTypeDescription
brushRendering.BrushRendering brush
colorCommon.ColorRendering color
updatedAreaCommon.RectCurrent modified segments area
preliminaryAreaCommon.RectLast preliminary update area
strokeBoundsCommon.RectCurrent stroke area
affectedAreaCommon.RectRuntime graphics updates area for drawn segments + preliminary area

Since:

  • version 1.0

Methods

abort()

Restarts StrokeRenderer instance lifecycle for next usage

(abstract) blendStroke(layeropt, dirtyAreaopt, blendModeopt)

Blends completed stroke with another layer

Parameters:
NameTypeAttributesDefaultDescription
layerRendering.OffscreenLayer<optional>this.canvastarget layer for stroke blending
dirtyAreaCommon.Rect<optional>this.strokeBoundsblending area
blendModeRendering.BlendMode<optional>this.blendModeblending mode

(abstract) blendUpdatedArea(layeropt)

Blends affected area with another layer

Parameters:
NameTypeAttributesDefaultDescription
layerRendering.OffscreenLayer<optional>this.canvastarget layer for stroke blending, where blendMode is previously configured

configure(settings)

Configures rendering. First call is used for initialilzation.

Parameters:
NameTypeDescription
settingsRendering.ComposeStyleRenderer configuration settings

draw(path, endStrokeopt)

Render data input

Parameters:
NameTypeAttributesDefaultDescription
pathPathBuilding.InkPath|Strokeinput
endStrokeboolean<optional>falseapplicable only when path is Path, when true caps end of stroke and completes stroke rendering

(abstract) drawPreliminary(path)

Render preliminary curve

Parameters:
NameTypeDescription
pathPathBuilding.InkPath2Dprediction input

(abstract) drawSegment()

(abstract) drawStroke()

requestComposeLayer() → Rendering.OffscreenLayer

When data is composed, raster data could be acquired. This action resets stroke renderer internal state.

Returns:

Composition layer

Type

Rendering.OffscreenLayer

(abstract) reset()

Reset current state

resize()

Resize underlying layers

setTransform(matrix)

Configures ink transformation over stroke layer and it's preliminary when available

Parameters:
NameTypeDescription
matrixCommon.Matrix

toStroke(builder, strokeIDopt) → Stroke

Converts current drawed path to stroke

Parameters:
NameTypeAttributesDefaultDescription
builderPathBuilding.InkBuilderbuilder used for path building
strokeIDstring.<GUID><optional>auto generated GUIDStroke identifier
Returns:

stroke

Type

Stroke

Home