Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();

            // Custom init.
            int    width, height;
            string param, name;

            Circles.InitParams(out name, out width, out height, out param, out tooltip);
            numericXres.Value = Math.Max(width, 10);
            numericYres.Value = Math.Max(height, 10);
            textParam.Text    = param ?? "";

            Text += " (" + rev + ") '" + name + '\'';
        }
Ejemplo n.º 2
0
        private void redraw()
        {
            int width  = (int)numericXres.Value;
            int height = (int)numericYres.Value;

            buttonSave.Enabled = false;

            Stopwatch sw = new Stopwatch();

            sw.Start();

            Canvas c = new Canvas(width, height);

            Circles.Draw(c, textParam.Text);
            Bitmap newImage = c.Finish();

            sw.Stop();
            float elapsed = 0.001f * sw.ElapsedMilliseconds;

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

            buttonSave.Enabled = true;
        }