imageeditor.AddText("NewText", new TextSettings() { Bounds = new Rectangle(0,80,25,10) }); |
//Toolbar item selected event
private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
{
string text = e.ToolbarItem.Text;
if (text == "AddText")
{
//... . .
//... . .
}
else if (e.ToolbarItem.Name == "Save")
{
imageeditor.AddText("Saved", new TextSettings());
e.Cancel = true;
Device.StartTimer(TimeSpan.FromSeconds(5), () =>
{
imageeditor.Save();
return false;
});
}
//... . .
//... . .
} |
editor.ToolbarSettings.ToolbarItemSelected += ToolbarSettings_ToolbarItemSelected;
private void ToolbarSettings_ToolbarItemSelected(object sender, Syncfusion.SfImageEditor.XForms.ToolbarItemSelectedEventArgs e)
{
var headertoolBar = e.ToolbarItem as HeaderToolbarItem;
var footertoolBar = e.ToolbarItem as FooterToolbarItem;
if (headertoolBar != null)
{
if (headertoolBar.Name == "Save")
{
editor.SetToolbarItemVisibility("Save", false);
}
else
{
editor.SetToolbarItemVisibility("Save", true);
}
}
if (footertoolBar != null )
{
editor.SetToolbarItemVisibility("Save", true);
}
} |
editor.ToolbarSettings.ToolbarItems[2].Icon = ImageSource.FromResource("ImageEditorSample.SendBack.png"); |