RecordingCanvas.DrawTextRun 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| DrawTextRun(ICharSequence, Int32, Int32, Int32, Int32, Single, Single, Boolean, Paint) |
畫出一連串文字,全部朝單一方向,並可選擇為複雜文字形狀提供上下文。 |
| DrawTextRun(Char[], Int32, Int32, Int32, Int32, Single, Single, Boolean, Paint) |
畫出一連串文字,全部朝單一方向,並可選擇為複雜文字形狀提供上下文。 |
DrawTextRun(ICharSequence, Int32, Int32, Int32, Int32, Single, Single, Boolean, Paint)
畫出一連串文字,全部朝單一方向,並可選擇為複雜文字形狀提供上下文。
[Android.Runtime.Register("drawTextRun", "(Ljava/lang/CharSequence;IIIIFFZLandroid/graphics/Paint;)V", "", ApiSince=29)]
public override sealed void DrawTextRun(Java.Lang.ICharSequence text, int start, int end, int contextStart, int contextEnd, float x, float y, bool isRtl, Android.Graphics.Paint paint);
[<Android.Runtime.Register("drawTextRun", "(Ljava/lang/CharSequence;IIIIFFZLandroid/graphics/Paint;)V", "", ApiSince=29)>]
override this.DrawTextRun : Java.Lang.ICharSequence * int * int * int * int * single * single * bool * Android.Graphics.Paint -> unit
參數
- text
- ICharSequence
- start
- Int32
文字開始時要渲染。 在此立場之前的數據可用於塑造背景。
- end
- Int32
文字的結尾要渲染。 此位置或之後的資料可用於塑造上下文。
- contextStart
- Int32
形成上下文起始點的索引
- contextEnd
- Int32
形狀上下文結束的指標
- x
- Single
繪製文字的 x 位置
- y
- Single
繪製文字的Y位
- isRtl
- Boolean
跑道是否朝 RTL 方向
- paint
- Paint
- 屬性
備註
畫出一連串文字,全部朝單一方向,並可選擇為複雜文字形狀提供上下文。 這段文字從頭到尾包含了文字中的字元。 此外,範圍上下文開始到上下文結束也用於複雜文字形狀,例如阿拉伯文文字可能因旁邊文字而呈現不同的形狀。 所有超出範圍的文字 開始......contextEnd 被忽略。 從開頭到結尾的文字會排版並繪製。 上下文範圍對於上下文塑造非常有用,例如字距調整(Kerning)、阿拉伯語上下文形式。 滑行方向由 isRtl 明確指定。 因此,此方法僅適用於單向的連續。 文字的對齊由 Paint 的 TextAlign 值決定。 此外,0 <= contextStart <= start <= end = context <結束 = text <.長度必須在 entry 時保持。 另請參閱 Paint.getRunAdvance(char, int, int, int, int, boolean, int) 以取得對應的文字測量方法;繪製的文字前寬與該方法所得值相符。
Android 參考資料。android.graphics.RecordingCanvas.drawTextRun
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
DrawTextRun(Char[], Int32, Int32, Int32, Int32, Single, Single, Boolean, Paint)
畫出一連串文字,全部朝單一方向,並可選擇為複雜文字形狀提供上下文。
[Android.Runtime.Register("drawTextRun", "([CIIIIFFZLandroid/graphics/Paint;)V", "", ApiSince=29)]
public override sealed void DrawTextRun(char[] text, int index, int count, int contextIndex, int contextCount, float x, float y, bool isRtl, Android.Graphics.Paint paint);
[<Android.Runtime.Register("drawTextRun", "([CIIIIFFZLandroid/graphics/Paint;)V", "", ApiSince=29)>]
override this.DrawTextRun : char[] * int * int * int * int * single * single * bool * Android.Graphics.Paint -> unit
參數
- text
- Char[]
- index
- Int32
要渲染的文字起始
- count
- Int32
查爾斯伯爵要交代
- contextIndex
- Int32
塑造的脈絡起點。 不能超過指數。
- contextCount
- Int32
在塑造語境中字元數量。 contextIndex + contextCount 必須不小於 index + count。
- x
- Single
繪製文字的 x 位置
- y
- Single
繪製文字的Y位
- isRtl
- Boolean
跑道是否朝 RTL 方向
- paint
- Paint
- 屬性
備註
畫出一連串文字,全部朝單一方向,並可選擇為複雜文字形狀提供上下文。 更多細節請參見 drawTextRun(CharSequence, int, int, float, boolean, Paint)。 此方法使用字元陣列而非 CharSequence 來表示字串。 此外,為了與 drawText(char、int、int、float、float、Paint)中建立的模式保持一致,在此方法中使用 count 和 contextCount 取代結束位置的偏移;count = 結束 - 開始,contextCount = contextEnd - contextStart。
Android 參考資料。android.graphics.RecordingCanvas.drawTextRun
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。