menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ImageEditorTextStyle - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ImageEditorTextStyle

    Represents a class that contains the style for text annotation view.

    Inheritance
    System.Object
    ImageEditorTextStyle
    Namespace: Syncfusion.Maui.ImageEditor
    Assembly: Syncfusion.Maui.ImageEditor.dll
    Syntax
    public class ImageEditorTextStyle : BindableObject, ITextElement

    Constructors

    ImageEditorTextStyle()

    Declaration
    public ImageEditorTextStyle()

    Fields

    FontAttributesProperty

    Identifies the FontAttributes dependency property.

    Declaration
    public static readonly BindableProperty FontAttributesProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for FontAttributes dependency property.

    FontAutoScalingEnabledProperty

    Identifies the FontAutoScalingEnabled bindable property.

    Declaration
    public static readonly BindableProperty FontAutoScalingEnabledProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for FontAutoScalingEnabled bindable property.

    FontFamilyProperty

    Identifies the FontFamily dependency property.

    Declaration
    public static readonly BindableProperty FontFamilyProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for FontFamily dependency property.

    FontSizeProperty

    Identifies the FontSize dependency property.

    Declaration
    public static readonly BindableProperty FontSizeProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for FontSize dependency property.

    TextColorProperty

    Identifies the TextColor dependency property.

    Declaration
    public static readonly BindableProperty TextColorProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for TextColor dependency property.

    Properties

    FontAttributes

    Gets or sets the font attribute for the text.

    Declaration
    public FontAttributes FontAttributes { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.FontAttributes

    The default value is FontAttributes.None

    Examples

    The below examples shows, how to set font attributes for the text.

    • XAML
    • C#
    <imageEditor:SfImageEditor x:Name="imageEditor"
                               Source="syncfusion.png"
                               ImageLoaded = "OnImageLoaded"
    </imageEditor:SfImageEditor>
    private void OnImageLoaded(object sender, EventArgs e)
    {
        this.imageEditor.AddText("Entering", new ImageEditorTextSettings() { TextStyle = new ImageEditorTextStyle()  { FontAttributes = FontAttributes.Italic }});
    }

    FontAutoScalingEnabled

    Gets or sets a value indicating whether or not the font of the control should scale automatically according to the operating system settings.

    Declaration
    public bool FontAutoScalingEnabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    It accepts Boolean values, and the default value is false.

    FontFamily

    Gets or sets the font family for the text.

    Declaration
    public string FontFamily { get; set; }
    Property Value
    Type
    System.String
    Examples

    The below examples shows, how to set font family for the text.

    • XAML
    • C#
    <imageEditor:SfImageEditor x:Name="imageEditor"
                               Source="syncfusion.png"
                               ImageLoaded="OnImageLoaded"
    </imageEditor:SfImageEditor>
    private void OnImageLoaded(object sender, EventArgs e)
    {
        this.imageEditor.AddText("Entering", new ImageEditorTextSettings() { TextStyle= new ImageEditorTextStyle() { FontFamily="Arial"} });
    }

    FontSize

    Gets or sets the font size of the text.

    Declaration
    public double FontSize { get; set; }
    Property Value
    Type Description
    System.Double

    The default value is 30d

    Examples

    The below examples shows, how to set a size to the text.

    • XAML
    • C#
    <imageEditor:SfImageEditor x:Name="imageEditor"
                               Source="syncfusion.png"
                               ImageLoaded="OnImageLoaded"
    </imageEditor:SfImageEditor>
    private void OnImageLoaded(object sender, EventArgs e)
    {
        this.imageEditor.AddText("Entering", new ImageEditorTextSettings() { TextStyle= new ImageEditorTextStyle() { FontSize=20 } });
    }

    TextColor

    Gets or sets the color for the text.

    Declaration
    public Color TextColor { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Graphics.Color

    The default value is Colors.Red

    Examples

    The below examples shows, how to set a color to the text.

    • XAML
    • C#
    <imageEditor:SfImageEditor x:Name="imageEditor"
                               Source="syncfusion.png"
                               ImageLoaded="OnImageLoaded"
    </imageEditor:SfImageEditor>
    private void OnImageLoaded(object sender, EventArgs e)
    {
        this.imageEditor.AddText("Good Day", new ImageEditorTextSettings() { TextStyle= new ImageEditorTextStyle() { TextColor = Colors.Black } });
    }
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved