How to add text after image has been loaded in UWP?
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
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
Sample: