語言

Paint.GetTextBounds 方法

定義

多載

名稱 Description
GetTextBounds(ICharSequence, Int32, Int32, Rect)

取得文字邊界框並存入界限。

GetTextBounds(Char[], Int32, Int32, Rect)

回傳由呼叫者分配的界限內,包含所有字元且暗示原點為 (0,0) 的最小矩形。

GetTextBounds(String, Int32, Int32, Rect)

取得文字邊界框並存入界限。

GetTextBounds(ICharSequence, Int32, Int32, Rect)

取得文字邊界框並存入界限。

[Android.Runtime.Register("getTextBounds", "(Ljava/lang/CharSequence;IILandroid/graphics/Rect;)V", "GetGetTextBounds_Ljava_lang_CharSequence_IILandroid_graphics_Rect_Handler", ApiSince=29)]
public virtual void GetTextBounds(Java.Lang.ICharSequence text, int start, int end, Android.Graphics.Rect bounds);
[<Android.Runtime.Register("getTextBounds", "(Ljava/lang/CharSequence;IILandroid/graphics/Rect;)V", "GetGetTextBounds_Ljava_lang_CharSequence_IILandroid_graphics_Rect_Handler", ApiSince=29)>]
abstract member GetTextBounds : Java.Lang.ICharSequence * int * int * Android.Graphics.Rect -> unit
override this.GetTextBounds : Java.Lang.ICharSequence * int * int * Android.Graphics.Rect -> unit

參數

text
ICharSequence

用文字測量並返回其界限

start
Int32

文本中第一個字元的索引

end
Int32

在文字中最後一個字元之後再測量 1

bounds
Rect

回傳所有文本的聯集邊界。 必須由呼叫者分配

屬性

備註

取得文字邊界框並存入界限。

回傳由呼叫者分配的界限內,包含所有字元且暗示原點為 (0,0) 的最小矩形。

請注意,即使你通過 android.text.Spanned 實例,風格也會被忽略。 用於 android.text.StaticLayout 測量 的 android.text.Spanned界限。

Java 文件 android.graphics.Paint.getTextBounds(java.lang.CharSequence, int, int, android.graphics.Rect)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

GetTextBounds(Char[], Int32, Int32, Rect)

回傳由呼叫者分配的界限內,包含所有字元且暗示原點為 (0,0) 的最小矩形。

[Android.Runtime.Register("getTextBounds", "([CIILandroid/graphics/Rect;)V", "GetGetTextBounds_arrayCIILandroid_graphics_Rect_Handler")]
public virtual void GetTextBounds(char[]? text, int index, int count, Android.Graphics.Rect? bounds);
[<Android.Runtime.Register("getTextBounds", "([CIILandroid/graphics/Rect;)V", "GetGetTextBounds_arrayCIILandroid_graphics_Rect_Handler")>]
abstract member GetTextBounds : char[] * int * int * Android.Graphics.Rect -> unit
override this.GetTextBounds : char[] * int * int * Android.Graphics.Rect -> unit

參數

text
Char[]

用來測量並返回其聯合邊界的 Array

index
Int32

陣列中第一個要測量的 char 的索引

count
Int32

從指數開始測量的字元數

bounds
Rect

回傳所有文本的聯集邊界。 必須由呼叫者分配

屬性

備註

回傳由呼叫者分配的界限內,包含所有字元且暗示原點為 (0,0) 的最小矩形。

Java 文件 android.graphics.Paint.getTextBounds(char[], int, int, android.graphics.Rect)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

GetTextBounds(String, Int32, Int32, Rect)

取得文字邊界框並存入界限。

[Android.Runtime.Register("getTextBounds", "(Ljava/lang/String;IILandroid/graphics/Rect;)V", "GetGetTextBounds_Ljava_lang_String_IILandroid_graphics_Rect_Handler")]
public virtual void GetTextBounds(string? text, int start, int end, Android.Graphics.Rect? bounds);
[<Android.Runtime.Register("getTextBounds", "(Ljava/lang/String;IILandroid/graphics/Rect;)V", "GetGetTextBounds_Ljava_lang_String_IILandroid_graphics_Rect_Handler")>]
abstract member GetTextBounds : string * int * int * Android.Graphics.Rect -> unit
override this.GetTextBounds : string * int * int * Android.Graphics.Rect -> unit

參數

text
String

字串 以測量並回傳其界限

start
Int32

要測量的字串中第一個字元的索引

end
Int32

在要測量的字串最後一個字元後 1

bounds
Rect

回傳所有文本的聯集邊界。 必須由呼叫者分配

屬性

備註

取得文字邊界框並存入界限。

回傳由呼叫者分配的界限內,包含所有字元且暗示原點為 (0,0) 的最小矩形。

Java 文件 android.graphics.Paint.getTextBounds(java.lang.String, int, int, android.graphics.Rect)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於