예제 #1
0
        /// <summary>
        /// Handles the Click event of the buttonExport control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void buttonExport_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Title  = "Export to XAML Format";
            saveFileDialog.Filter = "XAML(*.xaml)|*.xaml|All files (*.*)|*.*";
            if (saveFileDialog.ShowDialog() == true)
            {
                VectorImageUtil.SaveXAML(saveFileDialog.FileName, this.ImageSourceContent);
            }
        }
예제 #2
0
        /// <summary>
        /// Handles the Click event of the menuItemSave control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
        private void menuItemSave_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Title  = "Save Image";
            saveFileDialog.Filter = "Bitmap(*.bmp)|*.bmp|JPEG(*.jpg,*.jpeg)|*.jpg;*.jpeg|Gif (*.gif)|*.gif|TIFF(*.tiff)|*.tiff|PNG(*.png)|*.png|WDP(*.wdp)|*.wdp|All files (*.*)|*.*";
            if (saveFileDialog.ShowDialog() == true)
            {
                VectorImageUtil.SaveImage(saveFileDialog.FileName, imgCanvas);
            }
        }
예제 #3
0
        /// <summary>
        /// Imports the Xaml contents.
        /// </summary>
        private void ImportXaml()
        {
            try
            {
                Visual visualElement = VectorImageUtil.ImportXaml(this.ImageSourceContent, richTextBoxXaml.Document);

                if (visualElement != null)
                {
                    if (visualElement is Image)
                    {
                        ImageSourceContent = (visualElement as Image).Source;
                    }
                    imgBrush.Visual = visualElement;
                    imgBorder.Fill  = imgBrush;
                }
            }
            catch (Exception ex)
            {
            }
        }