SKPaint.MeasureText Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
MeasureText(IntPtr, IntPtr, SKRect) |
Measures the specified UTF-8 encoded text. |
MeasureText(IntPtr, Int32, SKRect) |
Measures the specified UTF-8 encoded text. |
MeasureText(ReadOnlySpan<Char>, SKRect) | |
MeasureText(ReadOnlySpan<Byte>, SKRect) | |
MeasureText(IntPtr, IntPtr) |
Measures the specified UTF-8 encoded text. |
MeasureText(String, SKRect) |
Measures the specified text. |
MeasureText(Byte[], SKRect) |
Measures the specified text. |
MeasureText(String) |
Measures the specified text. |
MeasureText(ReadOnlySpan<Char>) | |
MeasureText(IntPtr, Int32) |
Measures the specified UTF-8 encoded text. |
MeasureText(ReadOnlySpan<Byte>) | |
MeasureText(Byte[]) |
Measures the specified text. |
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
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.
Applies to
MeasureText(ReadOnlySpan<Char>, SKRect)
public float MeasureText (ReadOnlySpan<char> text, ref SkiaSharp.SKRect bounds);
Parameters
- text
- ReadOnlySpan<Char>
- bounds
- SKRect
Returns
Applies to
MeasureText(ReadOnlySpan<Byte>, SKRect)
public float MeasureText (ReadOnlySpan<byte> text, ref SkiaSharp.SKRect bounds);
Parameters
- text
- ReadOnlySpan<Byte>
- bounds
- SKRect
Returns
Applies to
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.
Applies to
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.
Applies to
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.
Applies to
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.
Applies to
MeasureText(ReadOnlySpan<Char>)
public float MeasureText (ReadOnlySpan<char> text);
Parameters
- text
- ReadOnlySpan<Char>
Returns
Applies to
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.
Applies to
MeasureText(ReadOnlySpan<Byte>)
public float MeasureText (ReadOnlySpan<byte> text);
Parameters
- text
- ReadOnlySpan<Byte>
Returns
Applies to
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.