Paint.GetTextBounds Method

Definition

Overloads

GetTextBounds(ICharSequence, Int32, Int32, Rect)

Retrieve the text boundary box and store to bounds.

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

Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).

GetTextBounds(String, Int32, Int32, Rect)

Retrieve the text boundary box and store to bounds.

GetTextBounds(ICharSequence, Int32, Int32, Rect)

Retrieve the text boundary box and store to bounds.

[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

Parameters

text
ICharSequence

text to measure and return its bounds

start
Int32

index of the first char in the text to measure

end
Int32

1 past the last char in the text to measure

bounds
Rect

returns the unioned bounds of all the text. Must be allocated by the caller

Attributes

Remarks

Retrieve the text boundary box and store to bounds.

Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).

Note that styles are ignored even if you pass android.text.Spanned instance. Use android.text.StaticLayout for measuring bounds of android.text.Spanned.

Java documentation for android.graphics.Paint.getTextBounds(java.lang.CharSequence, int, int, android.graphics.Rect).

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

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

Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (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

Parameters

text
Char[]

array of chars to measure and return their unioned bounds

index
Int32

index of the first char in the array to measure

count
Int32

the number of chars, beginning at index, to measure

bounds
Rect

returns the unioned bounds of all the text. Must be allocated by the caller

Attributes

Remarks

Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).

Java documentation for android.graphics.Paint.getTextBounds(char[], int, int, android.graphics.Rect).

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

GetTextBounds(String, Int32, Int32, Rect)

Retrieve the text boundary box and store to bounds.

[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

Parameters

text
String

string to measure and return its bounds

start
Int32

index of the first char in the string to measure

end
Int32

1 past the last char in the string to measure

bounds
Rect

returns the unioned bounds of all the text. Must be allocated by the caller

Attributes

Remarks

Retrieve the text boundary box and store to bounds.

Return in bounds (allocated by the caller) the smallest rectangle that encloses all of the characters, with an implied origin at (0,0).

Java documentation for android.graphics.Paint.getTextBounds(java.lang.String, int, int, android.graphics.Rect).

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