Ejemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // Generation of MainMathode instance
            MainMethods Ausgabe1 = new MainMethods();

            //  Implementation of QR-code to Form1
            Ausgabe1.Create_QRCode(this, "MIT Licence\nCopyright (c) 2020 SNUF2020\n\nhttps://github.com/SNUF2020");
        }
Ejemplo n.º 2
0
        }// Program-End with Exit-Button

        private async void button_Start_Click(object sender, EventArgs e)
        {
            // Generation of MainMathode instance
            MainMethods Ausgabe = new MainMethods();

            // Definition and Initiation
            Random rand = new Random(); // generation of instance of Random-class. in case of (number) = defined random value
            int    size = 500;          // definition of scale of playground

            // Definition of output window and return control instance
            Control outputWin = Ausgabe.OutPut_Window(size); // return Graphics instance for further use

            // Generation of PicturBox (w/ image) for graphic plotted in
            PictureBox Field = Ausgabe.GenPicBox(outputWin, size);

            // Generation of Graphics instance correlated to image in picturebox
            Graphics g = Graphics.FromImage(Field.Image);

            // Generation of playground
            Point[] playground = Ausgabe.PlayGround(g, size, radioButton_Sirpinski_3rand, radioButton_SquarNoice, radioButton_noRes_23,
                                                    radioButton_SquareRest1, radioButton_SquareRest2, radioButton_SquareRest3, radioButton_CenterPoint_13, radioButton_CenterPoint_23);

            // Definition of restriction etc.
            double [] para = Ausgabe.Para(radioButton_Sirpinski_3rand, radioButton_SquarNoice, radioButton_noRes_23, radioButton_SquareRest1,
                                          radioButton_SquareRest2, radioButton_SquareRest3, radioButton_CenterPoint_13, radioButton_CenterPoint_23, radioButton_secLast,
                                          radioButton_3rdLast);

            // Definition of color
            SolidBrush[] Farbe = Ausgabe.Farbe(radioButton_non);

            // Simulate growth
            await Task.Run(() => Ausgabe.OutPut(Field, g, rand, playground, size, para, Farbe));

            // methode running in async mode -> no freezing of desktop due to long-time calculation duration of this methode

            // Dispose graphic instance
            g.Dispose();
        }