Language

PathMeasure.GetSegment(Single, Single, Path, Boolean) Method

Definition

Given a start and stop distance, append to dst the intervening segment(s).

[Android.Runtime.Register("getSegment", "(FFLandroid/graphics/Path;Z)Z", "GetGetSegment_FFLandroid_graphics_Path_ZHandler")]
public virtual bool GetSegment(float startD, float stopD, Android.Graphics.Path? dst, bool startWithMoveTo);
[<Android.Runtime.Register("getSegment", "(FFLandroid/graphics/Path;Z)Z", "GetGetSegment_FFLandroid_graphics_Path_ZHandler")>]
abstract member GetSegment : single * single * Android.Graphics.Path * bool -> bool
override this.GetSegment : single * single * Android.Graphics.Path * bool -> bool

Parameters

startD
Single

The starting contour distance; negative values are raised to zero.

stopD
Single

The ending contour distance; values beyond the contour length are reduced to that length.

dst
Path

The path to which the extracted segment is appended.

startWithMoveTo
Boolean

Whether to begin the appended segment with a move to its starting point.

Returns

true when a segment is appended; false if none can be extracted, including when the adjusted start is not before the stop.

Attributes

Remarks

Given a start and stop distance, return in dst the intervening segment(s). If the segment is zero-length, return false, else return true. startD and stopD are pinned to legal values (0..getLength()). If startD >= stopD then return false (and leave dst untouched). Begin the segment with a moveTo if startWithMoveTo is true.

On android.os.Build.VERSION_CODES#KITKAT and earlier releases, the resulting path may not display on a hardware-accelerated Canvas. A simple workaround is to add a single operation to this path, such as dst.rLineTo(0, 0).

Java documentation for android.graphics.PathMeasure.getSegment(float, float, android.graphics.Path, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to