Bearbeiten

Freigeben über


SKPathEffect.CreateDash(Single[], Single) Method

Definition

Creates a dash path effect by specifying the dash intervals.

public static SkiaSharp.SKPathEffect CreateDash (float[] intervals, float phase);

Parameters

intervals
Single[]

The definition of the dash pattern via an even number of entries.

phase
Single

The offset into the intervals array. (mod the sum of all of the intervals).

Returns

Returns the new SKPathEffect, or null on error.

Remarks

The dash pattern is defined via an array containing an even number of entries (>=2), with the even indices specifying the length of "on" intervals, and the odd indices specifying the length of "off" intervals.

For example: if the intervals = new [] { 10, 20 } and the phase = 25, then the dash pattern will be: 5 pixels off, 10 pixels on, 20 pixels off, 10 pixels on, 20 pixels off, etc. A phase of -5, 25, 55, 85, etc. would all result in the same path, because the sum of all the intervals is 30.

Applies to