private void Grid1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            isDrawing = false;

            // Calculate rectangle cords/size
            BitmapSource bSource = ScreenCapturer.CaptureRegion((int)X, (int)Y, (int)W, (int)H);

            if (Settings.Default.AlwaysCopyToClipboard)
            {
                Clipboard.SetImage(bSource);
            }

            if (Settings.Default.AlwaysOpenToEditor)
            {
                new EditCaptureWindow(bSource).Show();
            }
            else
            {
                if (ScreenCapturer.Save(bSource))
                {
                    MainWindow.notification.ShowBalloonTip(this.Title, "File saved!", BalloonIcon.Info);
                }
                else
                {
                    MessageBox.Show("Oups! We couldn't save this file. Please check permissions.");
                }
            }

            this.Close();
        }
Esempio n. 2
0
        public void HandleCapture(BitmapSource bSource)
        {
            if (Settings.Default.AlwaysCopyToClipboard)
            {
                Clipboard.SetImage(bSource);
            }

            if (Settings.Default.AlwaysOpenToEditor)
            {
                new EditCaptureWindow(bSource).Show();
                this.Close();
            }
            else
            {
                this.Show();

                if (ScreenCapturer.Save(bSource))
                {
                    notification.ShowBalloonTip(this.Title, "File saved!", BalloonIcon.Info);
                }
                else
                {
                    MessageBox.Show("Oups! We couldn't save this file. Please check permissions.");
                }
            }
        }
Esempio n. 3
0
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.FileName = $"screenshot_{DateTime.Now.ToString("yyyy_dd_MM_HH_mm_ss")}";
            saveFileDialog.Filter   = "Bitmap Image (.bmp)|*.bmp|JPEG Image(.jpeg)|*.jpeg|PNG Image Image (.png)|*.png";

            if (saveFileDialog.ShowDialog() == true)
            {
                ScreenCapturer.Save(saveFileDialog.FileName, CapturedImage.Source as BitmapSource);
            }
        }