语言

PathMeasure.GetSegment(Single, Single, Path, Boolean) 方法

定义

给定开始和停止距离,追加到干预段(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

参数

startD
Single

起始轮廓距离;负值升至零。

stopD
Single

结束轮廓距离;超出轮廓长度的值将减少到该长度。

dst
Path

将提取的段追加到的路径。

startWithMoveTo
Boolean

是否以移动到其起点开始追加的段。

返回

true 追加段时; false 如果无法提取任何内容,则包括调整后的开始时间不在停止之前。

特性

注解

给定开始和停止距离,返回第二个干预段(s)。 如果段长度为零,则返回 false,否则返回 true。 startD 和 stopD 固定到法律值 (0..getLength())。 如果 startD >= stopD,则返回 false(并保留未更改的 dst)。 如果 startWithMoveTo 为 true,请使用 moveTo 开始段。

在 android.os.Build.VERSION_CODES#KITKAT 早期版本中,生成的路径可能不会显示在硬件加速画布上。 一个简单的解决方法是将单个操作添加到此路径,例如 dst.rLineTo(0, 0)。

Java文档android.graphics.PathMeasure.getSegment(float, float, android.graphics.Path, boolean)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于