Udostępnij za pośrednictwem


Paint.BreakText Method

Definition

Overloads

BreakText(String, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

BreakText(Char[], Int32, Int32, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

BreakText(ICharSequence, Int32, Int32, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

BreakText(String, Int32, Int32, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

BreakText(String, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

[Android.Runtime.Register("breakText", "(Ljava/lang/String;ZF[F)I", "GetBreakText_Ljava_lang_String_ZFarrayFHandler")]
public virtual int BreakText (string? text, bool measureForwards, float maxWidth, float[]? measuredWidth);
[<Android.Runtime.Register("breakText", "(Ljava/lang/String;ZF[F)I", "GetBreakText_Ljava_lang_String_ZFarrayFHandler")>]
abstract member BreakText : string * bool * single * single[] -> int
override this.BreakText : string * bool * single * single[] -> int

Parameters

text
String

The text to measure. Cannot be null.

measureForwards
Boolean

If true, measure forwards, starting with the first character in the string. Otherwise, measure backwards, starting with the last character in the string.

maxWidth
Single

The maximum width to accumulate.

measuredWidth
Single[]

Optional. If not null, returns the actual width measured.

Returns

The number of chars that were measured. Will always be <= abs(count).

Attributes

Remarks

Measure the text, stopping early if the measured width exceeds maxWidth. Return the number of chars that were measured, and if measuredWidth is not null, return in it the actual width measured.

Java documentation for android.graphics.Paint.breakText(java.lang.String, boolean, float, float[]).

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

BreakText(Char[], Int32, Int32, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

[Android.Runtime.Register("breakText", "([CIIF[F)I", "GetBreakText_arrayCIIFarrayFHandler")]
public virtual int BreakText (char[]? text, int index, int count, float maxWidth, float[]? measuredWidth);
[<Android.Runtime.Register("breakText", "([CIIF[F)I", "GetBreakText_arrayCIIFarrayFHandler")>]
abstract member BreakText : char[] * int * int * single * single[] -> int
override this.BreakText : char[] * int * int * single * single[] -> int

Parameters

text
Char[]

The text to measure. Cannot be null.

index
Int32

The offset into text to begin measuring at

count
Int32

The number of maximum number of entries to measure. If count is negative, then the characters are measured in reverse order.

maxWidth
Single

The maximum width to accumulate.

measuredWidth
Single[]

Optional. If not null, returns the actual width measured.

Returns

The number of chars that were measured. Will always be <= abs(count).

Attributes

Remarks

Measure the text, stopping early if the measured width exceeds maxWidth. Return the number of chars that were measured, and if measuredWidth is not null, return in it the actual width measured.

Java documentation for android.graphics.Paint.breakText(char[], int, int, float, float[]).

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

BreakText(ICharSequence, Int32, Int32, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

[Android.Runtime.Register("breakText", "(Ljava/lang/CharSequence;IIZF[F)I", "GetBreakText_Ljava_lang_CharSequence_IIZFarrayFHandler")]
public virtual int BreakText (Java.Lang.ICharSequence? text, int start, int end, bool measureForwards, float maxWidth, float[]? measuredWidth);
[<Android.Runtime.Register("breakText", "(Ljava/lang/CharSequence;IIZF[F)I", "GetBreakText_Ljava_lang_CharSequence_IIZFarrayFHandler")>]
abstract member BreakText : Java.Lang.ICharSequence * int * int * bool * single * single[] -> int
override this.BreakText : Java.Lang.ICharSequence * int * int * bool * single * single[] -> int

Parameters

text
ICharSequence

The text to measure. Cannot be null.

start
Int32

The offset into text to begin measuring at

end
Int32

The end of the text slice to measure.

measureForwards
Boolean

If true, measure forwards, starting at start. Otherwise, measure backwards, starting with end.

maxWidth
Single

The maximum width to accumulate.

measuredWidth
Single[]

Optional. If not null, returns the actual width measured.

Returns

The number of chars that were measured. Will always be <= abs(end - start).

Attributes

Remarks

Measure the text, stopping early if the measured width exceeds maxWidth. Return the number of chars that were measured, and if measuredWidth is not null, return in it the actual width measured.

Java documentation for android.graphics.Paint.breakText(java.lang.CharSequence, int, int, boolean, float, float[]).

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

BreakText(String, Int32, Int32, Boolean, Single, Single[])

Measure the text, stopping early if the measured width exceeds maxWidth.

public int BreakText (string? text, int start, int end, bool measureForwards, float maxWidth, float[]? measuredWidth);
member this.BreakText : string * int * int * bool * single * single[] -> int

Parameters

text
String

The text to measure. Cannot be null.

start
Int32

The offset into text to begin measuring at

end
Int32

The end of the text slice to measure.

measureForwards
Boolean

If true, measure forwards, starting at start. Otherwise, measure backwards, starting with end.

maxWidth
Single

The maximum width to accumulate.

measuredWidth
Single[]

Optional. If not null, returns the actual width measured.

Returns

The number of chars that were measured. Will always be <= abs(end - start).

Remarks

Measure the text, stopping early if the measured width exceeds maxWidth. Return the number of chars that were measured, and if measuredWidth is not null, return in it the actual width measured.

Java documentation for android.graphics.Paint.breakText(java.lang.CharSequence, int, int, boolean, float, float[]).

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