Пример #1
0
        private void buttonRedraw_Click(object sender, EventArgs e)
        {
            int width  = (int)numericXres.Value;
            int height = (int)numericYres.Value;

            Bitmap output = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);

            Stopwatch sw = new Stopwatch();

            sw.Start();

            Subdivision.TestImage(output, textParam.Text);

            sw.Stop();
            float elapsed = 1.0e-3f * sw.ElapsedMilliseconds;

            labelElapsed.Text = string.Format(CultureInfo.InvariantCulture, "Elapsed: {0:f3}s", elapsed);

            pictureBox1.Image  = outputImage = output;
            buttonSave.Enabled = true;
        }
Пример #2
0
        private void doRedraw()
        {
            buttonSave.Enabled = false;

            Stopwatch sw = new Stopwatch();

            sw.Start();

            Graphics gfx = Graphics.FromImage(output);

            gfx.Clear(Color.Black);
            gfx.Dispose();
            Subdivision.TestImage(output, textParam.Text);

            sw.Stop();
            float elapsed = 1.0e-3f * sw.ElapsedMilliseconds;

            labelElapsed.Text = string.Format(CultureInfo.InvariantCulture, "Elapsed: {0:f3}s", elapsed);

            pictureBox1.Image  = output;
            buttonSave.Enabled = true;
        }