How to rotate the text programmatically in image editor?
This section explains how to rotate the text programmatically in imageeditor.
Create SfImageEditor 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/xamarin/sfimageeditor/getting-started
For example, rotate the text based on slider value changed means
Step 1: Add slider control along with image editor in your sample
Step 2: To rotate the selected text programmatically without using resizing handler, you need to call
item selected event to get the selected text angle from text settings as like below code snippet
In C#
editor.ItemSelected += Editor_ItemSelected; private void Editor_ItemSelected(object sender, ItemSelectedEventArgs args) { if (args.Settings != null) { settings = (args.Settings as TextSettings); BindingContext = settings; } }
In Xaml
<Grid> <Grid.RowDefinitions> <RowDefinition Height="0.1*" ></RowDefinition> <RowDefinition Height="0.9*"></RowDefinition> </Grid.RowDefinitions> <Slider x:Name="slider" MinimumTrackColor="Blue" BackgroundColor="Black" Maximum="360" Value="{Binding Angle,Mode=TwoWay}" Grid.Row="0"></Slider> <imageeditor:SfImageEditor Grid.Row="1" x:Name="editor"> </imageeditor:SfImageEditor> </Grid>
Screen Shot:
Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/IESample494722982.zip