private void button1_Click(object sender, EventArgs e) { if (transformationPopup.IsDisposed) { transformationPopup = new TransformationPopup(); transformationPopup.transformCanceled += TransformationPopupOnTransformCanceled; } transformationPopup.percent = 0; transformationPopup.StartPosition = FormStartPosition.Manual; transformationPopup.Location = new Point(this.Location.X + (this.Width - transformationPopup.Width) / 2, this.Location.Y + (this.Height - transformationPopup.Height) / 2); transformationPopup.Show(this); this.Enabled = false; invertImageBackgroundWorker.RunWorkerAsync(); }
private void button2_Click(object sender, EventArgs e) { DialogResult result = colorDialog.ShowDialog(); // See if user pressed ok. if (result == DialogResult.OK) { // Set form background to the selected color. if (transformationPopup.IsDisposed) { transformationPopup = new TransformationPopup(); transformationPopup.transformCanceled += TransformationPopupOnTransformCanceled; } transformationPopup.percent = 0; transformationPopup.StartPosition = FormStartPosition.Manual; transformationPopup.Location = new Point(this.Location.X + (this.Width - transformationPopup.Width) / 2, this.Location.Y + (this.Height - transformationPopup.Height) / 2); transformationPopup.Show(this); this.Enabled = false; filterColorImageBackgroundWorker.RunWorkerAsync(); } }
private void brightnessTrackbar_MouseUp(object sender, MouseEventArgs e) { if (transformationPopup.IsDisposed) { transformationPopup = new TransformationPopup(); transformationPopup.transformCanceled += TransformationPopupOnTransformCanceled; } transformationPopup.percent = 0; transformationPopup.StartPosition = FormStartPosition.Manual; transformationPopup.Location = new Point(this.Location.X + (this.Width - transformationPopup.Width) / 2, this.Location.Y + (this.Height - transformationPopup.Height) / 2); transformationPopup.Show(this); this.Enabled = false; brightnessImageBackgroundWorker.RunWorkerAsync(brightnessTrackbar.Value); }