Example #1
0
        private void menu_project_new_Click(object sender, EventArgs e)
        {
            if (IsProjectSaved())
            {
                if (ofd_openimage.ShowDialog() == DialogResult.OK)
                {
                    GAVectorProject newcp = new GAVectorProject();
                    newcp.Properties = new GAProjectProperties();
                    Bitmap b = new Bitmap(ofd_openimage.FileName);

                    newcp.SourceImage    = new FastBitmap(b);
                    newcp.BestComparison = double.MaxValue;
                    fm_projectproperties frm = new fm_projectproperties();
                    frm.LoadProperties(newcp.Properties);
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        newcp.BestYet       = new GARepresentation(newcp.SourceImage.GetBitmap(), 10);
                        newcp.Properties    = frm.GetProperties();
                        newcp.Changed       = true;
                        CurrentProject      = newcp;
                        displaysourcebitmap = (Bitmap)CurrentProject.SourceImage.GetBitmap().Clone();
                        changed             = true;
                    }
                    else
                    {
                        // Cancelled, clean it all up
                        newcp = null;
                    }
                }
            }

            UpdateControlEnabled();
        }
Example #2
0
        private void menu_project_properties_Click(object sender, EventArgs e)
        {
            fm_projectproperties frm = new fm_projectproperties();

            frm.LoadProperties(CurrentProject.Properties);
            switch (frm.ShowDialog())
            {
            case DialogResult.OK:
                CurrentProject.Properties = frm.GetProperties();
                CurrentProject.Changed    = true;
                break;

            case DialogResult.Cancel:
                break;
            }

            UpdateControlEnabled();
        }