Articles in this section
Category / Section

How to add text after image has been loaded in UWP?

7 mins read

This section explains how to add text programmatically when image editor is loaded in a view.

 

Step 1: Create image editor sample with all necessary assemblies.

 

Please refer the below link to create a simple SfImageEditor sample along with the ways to configure it. https://help.syncfusion.com/uwp/sfimageeditor/getting-started

You can add text programmatically in the following two ways when image editor is loaded in a view:

  • Without image
  • With image

 

Step 2: To add text without image, call the AddText() method in the loaded event.

 

The following code sample demonstrates how to add text by calling the AddText() method in the loaded event.

 

C#

 

public WithoutImage()
{
    editor.Loaded += editor_Loaded; // Framework loaded event
}
 
private void editor_Loaded(object sender, RoutedEventArgs e)
{
    editor.AddText("Without Image", new TextSettings());
}

 

Screenshot

 

Add text when the image is not loaded using SfImageEditor control

 

 

Step 3: To add text with image, call the AddText() method in the imageloaded event.

 

The following code sample demonstrates how to add text by calling the AddText() method in the imageloaded event .

 

C#

 

public WithImage()
{
    editor.ImageLoaded += editor_ImageLoaded; // image editor ImageLoaded event
}
 
private void editor_ImageLoaded(object sender, ImageLoadedEventArgs e)
{
    editor.AddText("With Image", new TextSettings());
}

 

Screenshot

 

Add text after the image loaded using SfImageEditor control

 

Sample:

 

https://www.syncfusion.com/downloads/support/directtrac/general/ze/ImageEditor_GettingStarted1556040743.zip

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied