private void identifyForm_Load(object sender, EventArgs e)
        {
            var lines = File.ReadAllLines(@"buttons.txt");

            Main = Owner as Mainform;
            foreach (var str in lines)
            {
                var but = new Button();
                AddButton(but, str);
                if (!Directory.Exists(Main.DescPathToLibrary + str))
                {
                    Directory.CreateDirectory(Main.DescPathToLibrary + str);
                }
            }
            draw();
        }
 private void ComparsionForm_Load(object sender, EventArgs e)
 {
     main = Owner as Mainform;
     I    = main.I;
     if (main.DescList == null)
     {
         MessageBox.Show(@"Вначале обработайте изображение");
         return;
     }
     if (main.DescList.Count == 0)
     {
         MessageBox.Show(@"Вначале обработайте изображение");
         return;
     }
     EqualWithSimmetry(main.DescList[I].Difference);
     pictureBox5.Image = main.GetOnlyOneBitmap(main.DescList[I].SourceCircuit);
     pictureBox1.Image = new Bitmap(main.DescList[I].PathToImage);
     main.I++;
 }
        private void button1_Click(object sender, EventArgs e)
        {
            if (File.Exists("Settings.txt"))
            {
                File.Delete("Settings.txt");
            }

            Main = Owner as Mainform;

            using (var file = new StreamWriter(@"Settings.txt"))
            {
                file.WriteLine("CannyHighTh " + TH.Text);
                Main.CannyHighTh = Single.Parse(TH.Text);
                file.WriteLine("CannyLowTL " + TL.Text);
                Main.CannyLowTl = Single.Parse(TL.Text);
                file.WriteLine("CannyMaskSize " + MaskSize.Text);
                Main.CannyMaskSize = Int32.Parse(MaskSize.Text);
                file.WriteLine("CannySigma " + Sigma.Text);
                Main.CannySigma = Single.Parse(Sigma.Text);
                file.WriteLine("DescLengthBetweenObjects " + LengthBetweenObjects.Text);
                Main.DescLengthBetweenObjects = Int32.Parse(LengthBetweenObjects.Text);
                file.WriteLine("DescLengthInsideObject " + LengthInsideObject.Text);
                Main.DescLengthInsideObject = Int32.Parse(LengthInsideObject.Text);
                file.WriteLine("DescPointsCountInsideSegment " + PointsCountInsideSegment.Text);
                Main.DescPointsCountInsideSegment = Int32.Parse(PointsCountInsideSegment.Text);
                file.WriteLine("DescMinSegmentsCount " + MinSegmentsCount.Text);
                Main.DescMinSegmentsCount = Int32.Parse(MinSegmentsCount.Text);
                file.WriteLine("DescCorrelation " + Correlation.Text);
                Main.DescCorrelation = Double.Parse(Correlation.Text);
                file.WriteLine("DescPathToDesctiptors " + PathToDesctiptors.Text);
                Main.DescPathToDesctiptors = PathToDesctiptors.Text;
                file.WriteLine("DescPathToLibrary " + PathToLibrary.Text);
                Main.DescPathToLibrary = PathToLibrary.Text;
                file.WriteLine("OtherDifferenceBetweenTwoArrays" + OtherDifferenceBetweenTwoArrays.Text);
                Main.OtherDifferenceBetweenTwoArrays = Int32.Parse(OtherDifferenceBetweenTwoArrays.Text);
                file.Close();
            }
        }