Exemplo n.º 1
0
        private void mnuFileAnimate_Click(object sender, EventArgs e)
        {
            double c0_0, c0_1, c1_0, c1_1; int nframes;
            double param1 = plotCntrl.param1, param2 = plotCntrl.param2;

            if (!InputBoxForm.GetDouble("Initial c1:", param1, out c0_0))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Final c1:", param1, out c0_1))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Initial c2:", param2, out c1_0))
            {
                return;
            }
            if (!InputBoxForm.GetDouble("Final c2:", param2, out c1_1))
            {
                return;
            }
            if (!InputBoxForm.GetInt("Number of frames:", 50, out nframes))
            {
                return;
            }

            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter           = "png files (*.png)|*.png";
            saveFileDialog1.RestoreDirectory = true;
            if (!(saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK && saveFileDialog1.FileName.Length > 0))
            {
                return;
            }
            string sfilename = saveFileDialog1.FileName;
            double c0_inc    = (c0_1 - c0_0) / nframes;
            double c1_inc    = (c1_1 - c1_0) / nframes;

            for (int i = 0; i < nframes; i++)
            {
                plotCntrl.param1 = c0_0;
                plotCntrl.param2 = c1_0;
                plotCntrl.renderToDiskSave(400, 400, sfilename.Replace(".png", "_" + i.ToString("000") + ".png"));
                c0_0 += c0_inc;
                c1_0 += c1_inc;
            }
        }
Exemplo n.º 2
0
        private void mnuAdvancedRenderSize_Click(object sender, EventArgs e)
        {
            int width, height;

            if (!InputBoxForm.GetInt("Render Width:", nRenderWidth, out width))
            {
                return;
            }
            if (!InputBoxForm.GetInt("Render Height:", nRenderHeight, out height))
            {
                return;
            }
            if (width > 0 && height > 0)
            {
                nRenderHeight = height; nRenderWidth = width;
            }
        }