Share via


IStringSizeService.GetStringSize Method

Definition

Overloads

GetStringSize(String, IFont, Single)

Gets the size of a string when rendered with the specified font and font size.

GetStringSize(String, IFont, Single, HorizontalAlignment, VerticalAlignment)

Gets the size of a string when rendered with the specified font, font size, and alignments.

GetStringSize(String, IFont, Single)

Source:
IStringSizeService.cs
Source:
IStringSizeService.cs
Source:
IStringSizeService.cs

Gets the size of a string when rendered with the specified font and font size.

public:
 Microsoft::Maui::Graphics::SizeF GetStringSize(System::String ^ value, Microsoft::Maui::Graphics::IFont ^ font, float fontSize);
public Microsoft.Maui.Graphics.SizeF GetStringSize(string value, Microsoft.Maui.Graphics.IFont font, float fontSize);
abstract member GetStringSize : string * Microsoft.Maui.Graphics.IFont * single -> Microsoft.Maui.Graphics.SizeF
Public Function GetStringSize (value As String, font As IFont, fontSize As Single) As SizeF

Parameters

value
String

The string to measure.

font
IFont

The font to use for measurement.

fontSize
Single

The font size in points.

Returns

The size of the string in device-independent units.

Applies to

GetStringSize(String, IFont, Single, HorizontalAlignment, VerticalAlignment)

Source:
IStringSizeService.cs
Source:
IStringSizeService.cs
Source:
IStringSizeService.cs

Gets the size of a string when rendered with the specified font, font size, and alignments.

public:
 Microsoft::Maui::Graphics::SizeF GetStringSize(System::String ^ value, Microsoft::Maui::Graphics::IFont ^ font, float fontSize, Microsoft::Maui::Graphics::HorizontalAlignment horizontalAlignment, Microsoft::Maui::Graphics::VerticalAlignment verticalAlignment);
public Microsoft.Maui.Graphics.SizeF GetStringSize(string value, Microsoft.Maui.Graphics.IFont font, float fontSize, Microsoft.Maui.Graphics.HorizontalAlignment horizontalAlignment, Microsoft.Maui.Graphics.VerticalAlignment verticalAlignment);
abstract member GetStringSize : string * Microsoft.Maui.Graphics.IFont * single * Microsoft.Maui.Graphics.HorizontalAlignment * Microsoft.Maui.Graphics.VerticalAlignment -> Microsoft.Maui.Graphics.SizeF
Public Function GetStringSize (value As String, font As IFont, fontSize As Single, horizontalAlignment As HorizontalAlignment, verticalAlignment As VerticalAlignment) As SizeF

Parameters

value
String

The string to measure.

font
IFont

The font to use for measurement.

fontSize
Single

The font size in points.

horizontalAlignment
HorizontalAlignment

The horizontal alignment of the text.

verticalAlignment
VerticalAlignment

The vertical alignment of the text.

Returns

The size of the string in device-independent units.

Applies to