public static void perform(operation_d operation) { using (UnshownBusyDlg f = new UnshownBusyDlg(operation)) { f.ShowDialog(); } }
private void 画質QToolStripMenuItem_Click(object sender, EventArgs e) { this.mtEnabled = false; this.Visible = false; Bitmap imgSample = null; { MonitorCenter.Monitor m = Ground.i.monitorCenter.get(0); int l = m.l; int t = m.t; int w = m.w; int h = m.h; // QualityDlg.pbSample のサイズに合わせる。 { w = Math.Min(w, 700); h = Math.Min(h, 400); } UnshownBusyDlg.perform(delegate { Thread.Sleep(500); // MainWin が完全に隠れるのを待つ。 imgSample = CaptureScreen.getRectangle(l, t, w, h); }); } this.Visible = true; using (QualityDlg f = new QualityDlg(imgSample)) { f.ShowDialog(); } this.mtEnabled = true; }