private void ChooseAreaBtn_Click(object sender, RoutedEventArgs e) { if (isAllWin == false && SelectedHwnd == 0) { HandyControl.Controls.Growl.Error(Application.Current.Resources["ChooseOCRAreaPage_NextErrorHint"].ToString()); return; } BitmapImage img; if (isAllWin == true) { img = ImageProcFunc.ImageToBitmapImage(ScreenCapture.GetAllWindow()); } else { img = ImageProcFunc.ImageToBitmapImage(ScreenCapture.GetWindowCapture((IntPtr)SelectedHwnd)); } ScreenCaptureWindow scw = new ScreenCaptureWindow(img); scw.Width = img.PixelWidth; scw.Height = img.PixelHeight; scw.Topmost = true; scw.Top = 0; scw.Left = 0; scw.Show(); }
protected override void OnStartup(StartupEventArgs e) { //var win = new ValidationWindow(); var win = new ScreenCaptureWindow(); win.Show(); }
private void ChooseAreaBtn_Click(object sender, RoutedEventArgs e) { if (isAllWin == false && SelectedHwnd == 0) { HandyControl.Controls.Growl.Error("请先选择窗口!"); return; } BitmapImage img; if (isAllWin == true) { img = ImageProcFunc.ImageToBitmapImage(ScreenCapture.GetAllWindow()); } else { img = ImageProcFunc.ImageToBitmapImage(ScreenCapture.GetWindowCapture((IntPtr)SelectedHwnd)); } ScreenCaptureWindow scw = new ScreenCaptureWindow(img); scw.Width = img.PixelWidth; scw.Height = img.PixelHeight; scw.WindowStartupLocation = WindowStartupLocation.CenterScreen; scw.Show(); }
private void CaptureExpectedImageButton_Click(object sender, RoutedEventArgs e) { App.MainWindow.WindowState = WindowState.Minimized; ScreenCaptureWindow sc = new ScreenCaptureWindow(f); sc.Show(); ExpectedImageTextBox.Text = sc.GetPathToExpectedImage(); //ScreenAreaCoordinatesTextBox.Text = sc.GetCordinates(); TODO: Need to check to get the coordinates }
private void ChooseAreaBtn_Click(object sender, RoutedEventArgs e) { if (!isAllWin && SelectedHwnd == 0) { HandyControl.Controls.Growl.Error(Application.Current.Resources["ChooseOCRAreaPage_NextErrorHint"].ToString()); return; } BitmapImage img; if (isAllWin) { img = ImageProcFunc.ImageToBitmapImage(ScreenCapture.GetAllWindow()); } else { img = ImageProcFunc.ImageToBitmapImage(ScreenCapture.GetWindowCapture((IntPtr)SelectedHwnd)); } ScreenCaptureWindow scw = new ScreenCaptureWindow(img); scw.WindowState = WindowState.Maximized; scw.Show(); }