private void RenderButton_Click(object sender, EventArgs e)
        {
            this.Configuration.Scale = (double)this.ScaleNumeric.Value;

            foreach (Control c in this.Controls.OfType <Control>().Where(c => !(c is ProgressBar)))
            {
                c.Enabled = false;
            }

            ProgressProvider progress     = new ProgressProvider((s, a) => this.Invoke((Action)(() => this.MainProgressBar.Value = (int)(100 * (s as ProgressProvider).Progress))));
            Thread           renderThread = new Thread((ThreadStart)(() =>
            {
                Bitmap rendered = MultislitRenderer.RenderHighRes(this.Configuration, new Size((int)this.WidthNumeric.Value, (int)this.HeightNumeric.Value), progress);
                this.Invoke((Action)(() =>
                {
                    ImageSavingHelper.Save(rendered);
                    this.Close();
                }));
            }));

            renderThread.Start();
        }
Ejemplo n.º 2
0
 private void Configurator_SaveCurrent(object sender, EventArgs e)
 {
     ImageSavingHelper.Save(this.RenderingSurface.RenderToBitmap());
 }