From eede99a5052ae92c4f23223c2dc372207a8ff569 Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 2 Jul 2020 17:25:46 -0500 Subject: [PATCH] simplify a few mainform methods with the ToClipBoard() extension method --- src/BizHawk.Client.EmuHawk/MainForm.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index b1a43052f7..e77168754f 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -1058,23 +1058,15 @@ namespace BizHawk.Client.EmuHawk public void TakeScreenshotToClipboard() { - using (var bb = Config.ScreenshotCaptureOsd ? CaptureOSD() : MakeScreenshotImage()) - { - using var img = bb.ToSysdrawingBitmap(); - Clipboard.SetImage(img); - } - + using var bb = Config.ScreenshotCaptureOsd ? CaptureOSD() : MakeScreenshotImage(); + bb.ToSysdrawingBitmap().ToClipBoard(); AddOnScreenMessage("Screenshot (raw) saved to clipboard."); } private void TakeScreenshotClientToClipboard() { - using (var bb = DisplayManager.RenderOffscreen(_currentVideoProvider, Config.ScreenshotCaptureOsd)) - { - using var img = bb.ToSysdrawingBitmap(); - Clipboard.SetImage(img); - } - + using var bb = DisplayManager.RenderOffscreen(_currentVideoProvider, Config.ScreenshotCaptureOsd); + bb.ToSysdrawingBitmap().ToClipBoard(); AddOnScreenMessage("Screenshot (client) saved to clipboard."); }