Exemplo n.º 1
0
 public DrawForm()
 {
     InitializeComponent();
     counter        = 0;
     drawingOptions = new DrawingOptions();
     figuresStorage = new LinesStorage();
     graphics       = canvas.CreateGraphics();
 }
Exemplo n.º 2
0
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Image file|*.drw";
            openFileDialog.Title  = "Open File";
            openFileDialog.ShowDialog();
            if (openFileDialog.FileName != "")
            {
                lastFilename = openFileDialog.FileName;
                FileStream      fileStream = new FileStream(openFileDialog.FileName, FileMode.Open, FileAccess.Read);
                BinaryFormatter bf         = new BinaryFormatter();
                figuresStorage = (LinesStorage)bf.Deserialize(fileStream);
                fileStream.Close();
                reDrawContent(true);
            }
        }