private void OnHotkey(int HotkeyID) { if (HotkeyID == hotKey_Ctrl_F2) { this.WindowState = FormWindowState.Normal; this.Focus(); checkRes(ScreenCut.PrtSrc(), this.chb_auto.Checked); } }
private void OnHookKeyDown(object sender, HookEventArgs e) { SetKeyDown(e.Key); if (IsKeyDown(Key.PrintScreen)) { var screenCut = new ScreenCut() { Topmost = true }; screenCut.Activate(); screenCut.Closing += delegate { SetKeyUp(Key.PrintScreen); }; screenCut.ShowDialog(); } else { if (keys.Count == 2 && IsKeyDown(Key.LeftAlt)) { var _key = Win32Api.GetCharFromKey(e.Key).ToString().ToUpper(); if (string.IsNullOrWhiteSpace(_key)) { return; } var offset = 0.0; var scrollViewer = ControlsHelper.FindChild <ScrollViewer>(AppSwitchList, "PART_ScrollViewer"); var elementList = ControlsHelper.FindVisualChildren <Border>(AppSwitchList).ToList(); var isFind = false; for (var i = 0; i < elementList.Count; i++) { var element = elementList[i]; if (isFind) { break; } if (element.Tag != null) { offset += element.ActualHeight; if (element.Tag.ToString().Equals(_key)) { offset -= element.ActualHeight; scrollViewer.ScrollToVerticalOffset(offset); isFind = true; } } } KeyDownText.Text = _key; KeyDownPanel.Visibility = Visibility.Visible; } } }
private void btn_prtsrc_Click(object sender, EventArgs e) { Mat mat = ScreenCut.PrtSrc(); Cv2.ImShow("ss", mat); }
private void btn_auto_Click(object sender, EventArgs e) { checkRes(ScreenCut.PrtSrc(), this.chb_auto.Checked); }