public MainWindow()
        {
            InitializeComponent();
            CanvasTool   = new CanvasTools(main_canvas);
            penColor     = Colors.Black;
            fillColor    = Colors.Black;
            penThickness = 5;
            currentZoom  = new ScaleTransform();
            //Point1 = "70,130" Point2 = "220,20" Point3 = "180,160"
            //BezierSegment curve = new BezierSegment(new Point(70, 130), new Point(320, 200), new Point(180, 416), true);

            //// Set up the Path to insert the segments
            //PathGeometry path = new PathGeometry();

            //PathFigure pathFigure = new PathFigure();
            //pathFigure.StartPoint = new Point(20, 20);
            //pathFigure.IsClosed = false;
            //path.Figures.Add(pathFigure);


            //pathFigure.Segments.Add(curve);

            //System.Windows.Shapes.Path p = new System.Windows.Shapes.Path();
            //p.Stroke = Brushes.Red;
            //p.Data = path;

            //main_canvas.Children.Add(p); // H
        }
Exemplo n.º 2
0
        private void JpegQualityOk_Click(object sender, RoutedEventArgs e)
        {
            //((MainWindow)this.Owner).OpenSaveFileDialog();
            //((MainWindow)Application.Current.MainWindow).Sh


            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter = "Jpeg Image|*.jpg";
            saveFileDialog1.Title  = "Save Image File";
            saveFileDialog1.ShowDialog();
            this.Close();

            // If the file name is not an empty string open it for saving.
            if (saveFileDialog1.FileName != "")
            {
                CanvasTools ct = new CanvasTools(((MainWindow)Application.Current.MainWindow).main_canvas);
                ct.SaveJpegFile(((MainWindow)Application.Current.MainWindow).main_canvas, saveFileDialog1.FileName, quality);
            }
        }