Exemple #1
0
        private void CaptureArea(CancellationToken token)
        {
            try {
                _selectionForm.Close();
                _selectionForm = null;
            } catch {
            }
            _selectionForm = new AreaSelectionForm();
            var result = _selectionForm.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }
            if (result == DialogResult.OK)
            {
                Rectangle selected = _selectionForm.SelectedRectangle;
                if (selected.Width == 0 || selected.Height == 0)
                {
                    return;
                }
                Image screenshot = ScreenCaptureHelper.CaptureScreens();
                EditAndUploadIfChecked(screenshot, selected, token);
            }
        }
Exemple #2
0
        private void CaptureScreen(CancellationToken token)
        {
            Image screenshot = ScreenCaptureHelper.CaptureScreens();

            EditAndUploadIfChecked(screenshot, screenshot.GetBounds(), token);
        }