SKPaint.MeasureText Method

Definition

Overloads

MeasureText(Byte[])

Measures the specified text.

MeasureText(String)

Measures the specified text.

MeasureText(Byte[], SKRect)

Measures the specified text.

MeasureText(IntPtr, Int32)

Measures the specified UTF-8 encoded text.

MeasureText(IntPtr, IntPtr)

Measures the specified UTF-8 encoded text.

MeasureText(String, SKRect)

Measures the specified text.

MeasureText(IntPtr, Int32, SKRect)

Measures the specified UTF-8 encoded text.

MeasureText(IntPtr, IntPtr, SKRect)

Measures the specified UTF-8 encoded text.

MeasureText(Byte[])

Measures the specified text.

public float MeasureText (byte[] text);

Parameters

text
Byte[]

The text to be measured.

Returns

Returns the width of the text.

Remarks

This will return the vertical measure if this is vertical text, in which case the returned value should be treated has a height instead of a width.

MeasureText(String)

Measures the specified text.

public float MeasureText (string text);

Parameters

text
String

The text to be measured.

Returns

Returns the width of the text.

Remarks

This will return the vertical measure if this is vertical text, in which case the returned value should be treated has a height instead of a width.

MeasureText(Byte[], SKRect)

Measures the specified text.

public float MeasureText (byte[] text, ref SkiaSharp.SKRect bounds);

Parameters

text
Byte[]

The text to be measured.

bounds
SKRect

The bounds of the text relative to (0, 0)

Returns

Returns the width of the text.

Remarks

This will return the vertical measure if this is vertical text, in which case the returned value should be treated has a height instead of a width.

MeasureText(IntPtr, Int32)

Measures the specified UTF-8 encoded text.

public float MeasureText (IntPtr buffer, int length);

Parameters

buffer
IntPtr

The pointer to a region holding text encoded using the encoding specified in TextEncoding format.

length
Int32

The number of bytes to read from the buffer.

Returns

Returns the width of the text.

Remarks

The buffer parameter is a pointer to a region in memory that contains text encoded in the TextEncoding format. This only consumes up to length bytes from the buffer.

MeasureText(IntPtr, IntPtr)

Measures the specified UTF-8 encoded text.

public float MeasureText (IntPtr buffer, IntPtr length);

Parameters

buffer
IntPtr

The pointer to a region holding text encoded using the encoding specified in TextEncoding format.

length
IntPtr

The number of bytes to read from the buffer.

Returns

Returns the width of the text.

Remarks

The buffer parameter is a pointer to a region in memory that contains text encoded in the TextEncoding format. This only consumes up to length bytes from the buffer.

MeasureText(String, SKRect)

Measures the specified text.

public float MeasureText (string text, ref SkiaSharp.SKRect bounds);

Parameters

text
String

The text to be measured.

bounds
SKRect

The bounds of the text relative to (0, 0)

Returns

Returns the width of the text.

Remarks

This will return the vertical measure if this is vertical text, in which case the returned value should be treated has a height instead of a width.

MeasureText(IntPtr, Int32, SKRect)

Measures the specified UTF-8 encoded text.

public float MeasureText (IntPtr buffer, int length, ref SkiaSharp.SKRect bounds);

Parameters

buffer
IntPtr

The pointer to a region holding text encoded using the encoding specified in TextEncoding format.

length
Int32

The number of bytes to read from the buffer.

bounds
SKRect

The bounds of the text relative to (0, 0)

Returns

Returns the width of the text.

Remarks

This will return the vertical measure if this is vertical text, in which case the returned value should be treated has a height instead of a width.

The buffer parameter is a pointer to a region in memory that contains text encoded in the TextEncoding format. This only consumes up to length bytes from the buffer.

MeasureText(IntPtr, IntPtr, SKRect)

Measures the specified UTF-8 encoded text.

public float MeasureText (IntPtr buffer, IntPtr length, ref SkiaSharp.SKRect bounds);

Parameters

buffer
IntPtr

The pointer to a region holding text encoded using the encoding specified in TextEncoding format.

length
IntPtr

The number of bytes to read from the buffer.

bounds
SKRect

The bounds of the text relative to (0, 0)

Returns

Returns the width of the text.

Remarks

This will return the vertical measure if this is vertical text, in which case the returned value should be treated has a height instead of a width.

The buffer parameter is a pointer to a region in memory that contains text encoded in the TextEncoding format. This only consumes up to length bytes from the buffer.

Applies to