private void LoadProjectButton_Click(object sender, EventArgs e) { List <AbstractFigure> figures = Saver.LoadProject(); if (figures != null) { Canvas.Current.Figures = figures; Canvas.Current.MainBitmap = Canvas.Current.Action(new DrawAllFigureOperationParameters()); pictureBox1.Image = Canvas.Current.MainBitmap; } }
private void saveFileAsDrawButton_Click(object sender, EventArgs e) { SaveFileDialog save = new SaveFileDialog(); save.Filter = "Image Files(*.draw;)| *.draw; "; save.FileName = tabMenu.SelectedTab.Text; if (save.ShowDialog() == DialogResult.OK) { Saver.SaveFileAsDraw(save.FileName, CurrentViewPort.ShapeList); tabMenu.SelectedTab.Text = Path.GetFileNameWithoutExtension(save.FileName); } statusBar.Items[0].Text = "Last action: Save project file as draw"; }
private void saveFileAsPngButton_Click(object sender, EventArgs e) { //Drawing our viewPort control to bitmap and then save it Bitmap bitmap = new Bitmap(viewPortStaticWidth, viewPortStaticHeight); CurrentViewPort.DrawToBitmap(bitmap, new Rectangle(0, 0, viewPortStaticWidth, viewPortStaticHeight)); SaveFileDialog save = new SaveFileDialog(); save.Filter = "Image Files(*.png;)| *.png; "; save.FileName = tabMenu.SelectedTab.Text; if (save.ShowDialog() == DialogResult.OK) { Saver.SaveFileAsPng(save.FileName, bitmap); tabMenu.SelectedTab.Text = Path.GetFileNameWithoutExtension(save.FileName); } statusBar.Items[0].Text = "Last action: Save project file as png"; }
private void SaveProjectButton_Click(object sender, EventArgs e) { Saver.SaveProject(Canvas.Current.Figures); }