Ejemplo n.º 1
0
 private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
 {
     if (e.ToolbarItem.Name == "Crop")
     {
         editor.SetToolbarItemVisibility("free,original,3:1,3:2,4:3,5:4,16:9", false);
     }
 }
Ejemplo n.º 2
0
        private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
        {
            isReplace = false;
            var name = e.ToolbarItem.Name;

            if (name == "Add")
            {
                notePanel.Visibility  = Visibility.Collapsed;
                ImagePanel.Visibility = Visibility.Visible;
            }
            else if (name == "Replace")
            {
                notePanel.Visibility  = Visibility.Collapsed;
                ImagePanel.Visibility = Visibility.Visible;
                isReplace             = true;
            }
            else if (name == "Front")
            {
                editor.BringToFront();
            }
            else if (name == "Back")
            {
                editor.SendToBack();
            }
        }
        private void OnToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
        {
            string text = string.Empty; //e.ToolbarItem.Name;

            if (text != "back")
            {
                if (e.ToolbarItem is FooterToolbarItem)
                {
                    text = e.ToolbarItem.Text;
                    e.MoveSubItemsToFooterToolbar = true;
                }
                else if (e.ToolbarItem is CustomToolbarItem)
                {
                    text = (e.ToolbarItem as CustomToolbarItem).CustomName;
                }
                else
                {
                    text = e.ToolbarItem.Text;
                }

                if (text == "Replace")
                {
                    isReplaced = true;
                    //imageEditor.ToolbarSettings.FooterToolbarHeight = 70;
                }
                else if (text == "back")
                {
                    isReplaced = false;
                    //imageEditor.ToolbarSettings.FooterToolbarHeight = 50;
                }
                else if (text == "Add")
                {
                    isReplaced = false;
                    //imageEditor.ToolbarSettings.FooterToolbarHeight = 70;
                }
                if (isReplaced && imageEditor.IsSelected && (text == "Typogy1" ||
                                                             text == "Typogy2" || text == "Typogy3" || text == "Typogy4" || text == "Typogy5" || text == "Typogy6"))
                {
                    imageEditor.Delete();
                    AddImage(text);
                }
                else if (text == "Typogy1" ||
                         text == "Typogy2" || text == "Typogy3" || text == "Typogy4" || text == "Typogy5" || text == "Typogy6")
                {
                    AddImage(text);
                }
                if (text == "Bring Front")
                {
                    imageEditor.BringToFront();
                }
                else if (text == "Send Back")
                {
                    imageEditor.SendToBack();
                }
            }
            else
            {
                isReplaced = false;
            }
        }
Ejemplo n.º 4
0
 private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
 {
     if (e.ToolbarItem.Text == "Crop")
     {
         imageEditor.ToggleCropping(true, 3);
         e.Cancel = true;
     }
 }
 /// <summary>
 /// Invoked when toolbar item is clicked.
 /// </summary>
 /// <param name="sender">Toolbar item</param>
 /// <param name="e">event arguments</param>
 private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
 {
     /// Cancel the default functionality only for save icon.
     if (e.ToolbarItem.Name == "Save")
     {
         e.Cancel = true;
         editor.Save();
     }
 }
Ejemplo n.º 6
0
        private void OnToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
        {
            string text = string.Empty;

            if (e.ToolbarItem is FooterToolbarItem)
            {
                text = e.ToolbarItem.Text;

                e.MoveSubItemsToFooterToolbar = true;
            }
            else if (e.ToolbarItem is CustomToolbarItem)
            {
                text = (e.ToolbarItem as CustomToolbarItem).CustomName;
            }
            else
            {
                text = e.ToolbarItem.Name;
            }

            if (text == "Replace")
            {
                isReplaced = true;
                //imageEditor.ToolbarSettings.FooterToolbarHeight = 70;
            }
            else if (text == "back")
            {
                isReplaced = false;
                //imageEditor.ToolbarSettings.FooterToolbarHeight = 50;
            }
            else if (text == "Add")
            {
                isReplaced = false;
                //imageEditor.ToolbarSettings.FooterToolbarHeight = 70;
            }
            if (isReplaced && imageEditor.IsSelected && (text == "ITypogy1" ||
                                                         text == "ITypogy2" || text == "ITypogy3" || text == "ITypogy4" || text == "ITypogy5" || text == "ITypogy6"))
            {
                imageEditor.Delete();
                AddImage(text);
            }
            if (!isReplaced)
            {
                AddImage(text);
            }
            if (text == "Bring Front")
            {
                imageEditor.BringToFront();
            }
            else if (text == "Send Back")
            {
                imageEditor.SendToBack();
            }
            var properties = typeof(Syncfusion.SfImageEditor.XForms.SfImageEditor).GetRuntimeProperties();
        }
Ejemplo n.º 7
0
 private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
 {
     if (e.ToolbarItem.Name == "CustomView1")
     {
         AddCustomView(e.ToolbarItem.Text);
     }
     if (e.ToolbarItem.Name == "CustomView2")
     {
         AddCustomView(e.ToolbarItem.Text);
     }
 }
Ejemplo n.º 8
0
        private void OnToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
        {
            string text = string.Empty;

            if (e.ToolbarItem is FooterToolbarItem)
            {
                text = e.ToolbarItem.Text;
                e.MoveSubItemsToFooterToolbar = true;
            }
            else if (e.ToolbarItem is CustomToolbarItem)
            {
                text = (e.ToolbarItem as CustomToolbarItem).CustomName;
            }

            if (text == "Replace")
            {
                isReplaced = true;
            }
            else if (text == "back")
            {
                isReplaced = false;
            }
            else if (text == "Add")
            {
                isReplaced = false;
            }
            if (isReplaced && editor.IsSelected && (text == "ITypogy1" ||
                                                    text == "ITypogy2" || text == "ITypogy3" || text == "ITypogy4"))
            {
                editor.Delete();
                AddImage(text);
            }
            if (!isReplaced)
            {
                AddImage(text);
            }
            if (text == "Front")
            {
                editor.BringToFront();
            }
            else if (text == "Back")
            {
                editor.SendToBack();
            }
        }
Ejemplo n.º 9
0
 private void ToolbarSettings_ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
 {
     if (e.ToolbarItem is CustomHeader)
     {
         var text = (e.ToolbarItem as CustomHeader).HeaderName;
         if (text == "Save Edits")
         {
             if (SelectedItem.ImageName == "Create New")
             {
                 popup.Visibility = Visibility.Visible;
                 grid.Visibility  = Visibility.Visible;
             }
             else
             {
                 imgedit.Save();
             }
         }
     }
 }
Ejemplo n.º 10
0
 void ToolbarItemSelected(object sender, ToolbarItemSelectedEventArgs e)
 {
     if (e.ToolbarItem is ToolbarItem)
     {
         var toolitem = e.ToolbarItem as ToolbarItem;
         if (!(toolitem is HeaderToolbarItem))
         {
             CropSelectionMenu.Hidden = false;
         }
         if (toolitem is HeaderToolbarItem)
         {
             sfImageEditor.Save();
         }
         else if (toolitem.Text == "Facebook Post")
         {
             sfImageEditor.ToggleCropping(1200, 900);
         }
         else if (toolitem.Text == "Facebook Cover")
         {
             sfImageEditor.ToggleCropping(851, 315);
         }
         else if (toolitem.Text == "Twitter Cover")
         {
             sfImageEditor.ToggleCropping(1500, 500);
         }
         else if (toolitem.Text == "Twitter Post")
         {
             sfImageEditor.ToggleCropping(1024, 512);
         }
         else if (toolitem.Text == "YouTubeChannel Cover")
         {
             sfImageEditor.ToggleCropping(2560, 1440);
         }
         else if (toolitem.Text == "Banner Types")
         {
             sfImageEditor.ToggleCropping(1200, 900);
         }
     }
 }