Paint.GetOffsetForAdvance 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
GetOffsetForAdvance(String, Int32, Int32, Int32, Int32, Boolean, Single)
回傳對應指定前進的字元偏移量。
public int GetOffsetForAdvance(string? text, int start, int end, int contextStart, int contextEnd, bool isRtl, float advance);
member this.GetOffsetForAdvance : string * int * int * int * int * bool * single -> int
參數
- text
- String
要衡量的文本。 不可為空值。
- start
- Int32
測量範圍起點的指數
- end
- Int32
測量範圍末端的指數 + 1
- contextStart
- Int32
形成上下文起始點的索引
- contextEnd
- Int32
測量範圍末端的指數 + 1
- isRtl
- Boolean
跑道是否朝 RTL 方向
- advance
- Single
寬度相對於運行開始
傳回
偏移指數
備註
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
GetOffsetForAdvance(ICharSequence, Int32, Int32, Int32, Int32, Boolean, Single)
[Android.Runtime.Register("getOffsetForAdvance", "(Ljava/lang/CharSequence;IIIIZF)I", "GetGetOffsetForAdvance_Ljava_lang_CharSequence_IIIIZFHandler", ApiSince=23)]
public virtual int GetOffsetForAdvance(Java.Lang.ICharSequence? text, int start, int end, int contextStart, int contextEnd, bool isRtl, float advance);
[<Android.Runtime.Register("getOffsetForAdvance", "(Ljava/lang/CharSequence;IIIIZF)I", "GetGetOffsetForAdvance_Ljava_lang_CharSequence_IIIIZFHandler", ApiSince=23)>]
abstract member GetOffsetForAdvance : Java.Lang.ICharSequence * int * int * int * int * bool * single -> int
override this.GetOffsetForAdvance : Java.Lang.ICharSequence * int * int * int * int * bool * single -> int
參數
- text
- ICharSequence
要衡量的文本。 不可為空值。
- start
- Int32
測量範圍起點的指數
- end
- Int32
測量範圍末端的指數 + 1
- contextStart
- Int32
形成上下文起始點的索引
- contextEnd
- Int32
測量範圍末端的指數 + 1
- isRtl
- Boolean
跑道是否朝 RTL 方向
- advance
- Single
寬度相對於運行開始
傳回
偏移指數
- 屬性
備註
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
GetOffsetForAdvance(Char[], Int32, Int32, Int32, Int32, Boolean, Single)
取得字串中最接近指定水平位置的字元偏移。
[Android.Runtime.Register("getOffsetForAdvance", "([CIIIIZF)I", "GetGetOffsetForAdvance_arrayCIIIIZFHandler", ApiSince=23)]
public virtual int GetOffsetForAdvance(char[]? text, int start, int end, int contextStart, int contextEnd, bool isRtl, float advance);
[<Android.Runtime.Register("getOffsetForAdvance", "([CIIIIZF)I", "GetGetOffsetForAdvance_arrayCIIIIZFHandler", ApiSince=23)>]
abstract member GetOffsetForAdvance : char[] * int * int * int * int * bool * single -> int
override this.GetOffsetForAdvance : char[] * int * int * int * int * bool * single -> int
參數
- text
- Char[]
要衡量的文本。 不可為空值。
- start
- Int32
測量範圍起點的指數
- end
- Int32
測量範圍末端的指數 + 1
- contextStart
- Int32
形成上下文起始點的索引
- contextEnd
- Int32
測量範圍末端的指數 + 1
- isRtl
- Boolean
跑道是否朝 RTL 方向
- advance
- Single
寬度相對於運行開始
傳回
偏移指數
- 屬性
備註
取得字串中最接近指定水平位置的字元偏移。
回傳值通常是 的 offset 值,該 #getRunAdvance 值對 最接近 advance,且位於字素簇邊界上。 因此,它是回應觸控或指標事件時,將游標定位的首選方法。 字素叢集邊界基於 Unicode 標準附錄 #29 ,但做了一些調整以提升使用者體驗。
注意 是 advance 相對於跑動開始時的(通常正)寬度測量。 因此,對於 RTL,它會計算從點到右邊的距離。
所有指標均相對於 的 text起始點。 此外, 0 <= contextStart <= start <= end <= contextEnd <= text.length 必須在進入時保留, start <= result <= end 回來時也會保留。
Java 文件 android.graphics.Paint.getOffsetForAdvance(char[], int, int, int, int, boolean, float)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。