public static void Capture() { if (screenForm == null) { return; } if (Busy) { return; } Busy = true; try { new System.Threading.Thread(() => { // 获取当前整个屏幕的截图 var image = GetScreen(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); screenForm.SetImage(image); }) { IsBackground = true }.Start(); screenForm.ShowWindow(); } catch (Exception e) { Busy = false; throw e; } }
public static void Capture() { if (screenForm == null) { return; } if (Busy) { return; } Busy = true; try { // 根据配置判断是否使用全屏 // 光标所在屏幕 var bounds = Util.GetScreenBounds(); // 获取当前整个屏幕的截图 var image = GetScreen(bounds.X, bounds.Y, bounds.Width, bounds.Height); screenForm.Bounds = bounds; screenForm.SetImage(image); screenForm.ShowWindow(); } catch (Exception e) { Busy = false; throw e; } }
public static void Capture() { if (screenForm == null) { return; } if (Busy) { return; } Busy = true; try { new System.Threading.Thread(() => { // 根据配置判断是否使用全屏 // 光标所在屏幕 var bounds = Util.GetScreenBounds(); // 获取当前整个屏幕的截图 var image = GetScreen(bounds.X, bounds.Y, bounds.Width, bounds.Height); screenForm.InvokeMethod(() => { screenForm.Bounds = bounds; screenForm.SetImage(image); }); }) { IsBackground = true }.Start(); screenForm.ShowWindow(); } catch (Exception e) { Busy = false; throw e; } }