ICanvas.GetStringSize 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
GetStringSize(String, IFont, Single) |
Calculates the area a string would occupy if drawn on the canvas. |
GetStringSize(String, IFont, Single, HorizontalAlignment, VerticalAlignment) |
Calculates the area a string would occupy if drawn on the canvas. |
GetStringSize(String, IFont, Single)
- Source:
- ICanvas.cs
- Source:
- ICanvas.cs
Calculates the area a string would occupy if drawn on the canvas.
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
String to calculate the size on.
- font
- IFont
The string's font type.
- fontSize
- Single
The string's font size.
Returns
The area the string would occupy on the canvas.
Applies to
GetStringSize(String, IFont, Single, HorizontalAlignment, VerticalAlignment)
- Source:
- ICanvas.cs
- Source:
- ICanvas.cs
Calculates the area a string would occupy if drawn on the canvas.
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
String to calculate the size on.
- font
- IFont
The string's font type.
- fontSize
- Single
The string's font size.
- horizontalAlignment
- HorizontalAlignment
Horizontal alignment options for the string.
- verticalAlignment
- VerticalAlignment
Vertical alignment options for the string.
Returns
The area the string would occupy on the canvas.