共用方式為


ICanvas.GetStringSize 方法

定義

多載

GetStringSize(String, IFont, Single)

計算在畫布上繪製時,字串會佔用的區域。

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

計算在畫布上繪製時,字串會佔用的區域。

GetStringSize(String, IFont, Single)

來源:
ICanvas.cs
來源:
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)

來源:
ICanvas.cs
來源:
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

字串的垂直對齊選項。

傳回

字串會佔用畫布上的區域。

適用於