ICanvas.GetStringSize 方法

定义

重载

GetStringSize(String, IFont, Single)

计算在画布上绘制时字符串将占用的区域。

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

计算在画布上绘制时字符串将占用的区域。

GetStringSize(String, IFont, Single)

Source:
ICanvas.cs
Source:
ICanvas.cs

计算在画布上绘制时字符串将占用的区域。

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

参数

value
String

要计算其大小的字符串。

font
IFont

字符串的字体类型。

fontSize
Single

字符串的字号。

返回

字符串将在画布上占用的区域。

适用于

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

Source:
ICanvas.cs
Source:
ICanvas.cs

计算在画布上绘制时字符串将占用的区域。

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

参数

value
String

要计算其大小的字符串。

font
IFont

字符串的字体类型。

fontSize
Single

字符串的字号。

horizontalAlignment
HorizontalAlignment

字符串的水平对齐选项。

verticalAlignment
VerticalAlignment

字符串的垂直对齐选项。

返回

字符串将在画布上占用的区域。

适用于