/// <summary> /// スクリーンショットを撮ってownerのバッファに登録する /// </summary> /// <param name="owner"></param> /// <returns></returns> public string takeScreenshot(MainForm owner) { var visible = owner.Visible; __screenshot = owner.TakeScreenshot(Screen.PrimaryScreen.Bounds); using (var form = new Form()) { if (form.WindowState == FormWindowState.Maximized) { form.WindowState = FormWindowState.Normal; } form.FormBorderStyle = FormBorderStyle.None; form.WindowState = FormWindowState.Maximized; form.Paint += (sender, e) => e.Graphics.DrawImage(__screenshot, Point.Empty); form.Show(); form.Activate(); owner.Hide(); ShowDialog(owner); } if (visible) owner.Show(); return __imageName; }
// コンスタラクタ public UI(MainForm owner) { this.owner = owner; }
/// <summary> /// コンストラクタ /// </summary> /// <param name="owner"></param> public ShortcutForm(MainForm owner) { InitializeComponent(); this.owner = owner; }