void BtnCreateClick(object sender, EventArgs e) { if (IP.SelectedTool == ImageProcessor.Tool.Vectorize && GrblFile.TimeConsumingFilling(IP.FillingDirection) && IP.FillingQuality > 2 && System.Windows.Forms.MessageBox.Show(this, $"Using { GrblCore.TranslateEnum(IP.FillingDirection)} with quality > 2 line/mm could be very time consuming with big image. Continue?", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) != DialogResult.OK) { return; } using (ConvertSizeAndOptionForm f = new ConvertSizeAndOptionForm(mCore)) { f.ShowDialog(this, IP); if (f.DialogResult == DialogResult.OK) { preventClose = true; Cursor = Cursors.WaitCursor; SuspendLayout(); TCOriginalPreview.SelectedIndex = 0; FlipControl.Enabled = false; BtnCreate.Enabled = false; WB.Visible = true; WB.Running = true; FormBorderStyle = FormBorderStyle.FixedSingle; TlpLeft.Enabled = false; MaximizeBox = false; ResumeLayout(); StoreSettings(); Project.AddSettings(GetActualSettings()); // Store project settings IP.GenerateGCode(); //processo asincrono che ritorna con l'evento "OnGenerationComplete" } } }
void BtnCreateClick(object sender, EventArgs e) { using (ConvertSizeAndOptionForm f = new ConvertSizeAndOptionForm(mCore)) { f.ShowDialog(IP); if (f.DialogResult == DialogResult.OK) { preventClose = true; Cursor = Cursors.WaitCursor; SuspendLayout(); TCOriginalPreview.SelectedIndex = 0; FlipControl.Enabled = false; BtnCreate.Enabled = false; WB.Visible = true; WB.Running = true; ResumeLayout(); StoreSettings(); ImageProcessor targetProcessor = IP.Clone() as ImageProcessor; IP.GenerateGCode(); if (IP.SelectedTool == ImageProcessor.Tool.Dithering) { mCore.UsageCounters.Dithering++; } else if (IP.SelectedTool == ImageProcessor.Tool.Line2Line) { mCore.UsageCounters.Line2Line++; } else if (IP.SelectedTool == ImageProcessor.Tool.Vectorize) { mCore.UsageCounters.Vectorization++; } else if (IP.SelectedTool == ImageProcessor.Tool.Centerline) { mCore.UsageCounters.Centerline++; } } } }
void BtnCreateClick(object sender, EventArgs e) { using (ConvertSizeAndOptionForm f = new ConvertSizeAndOptionForm()) { f.ShowDialog(IP); if (f.DialogResult == DialogResult.OK) { preventClose = true; Cursor = Cursors.WaitCursor; SuspendLayout(); TCOriginalPreview.SelectedIndex = 0; FlipControl.Enabled = false; BtnCreate.Enabled = false; WB.Visible = true; WB.Running = true; ResumeLayout(); StoreSettings(); ImageProcessor targetProcessor = IP.Clone() as ImageProcessor; IP.GenerateGCode(); } } }