Exemplo n.º 1
0
        private void ExecuteApplicationFormCapture()
        {
            string imageFolder = Path.GetDirectoryName(Model.ActiveDocument.Filename);

            var form = new ScreenCaptureForm()
            {
                // hide the main window on captures
                SaveFolder = imageFolder,
                Top        = Model.Window.Top,
                Left       = Model.Window.Left + 80,
                Height     = ScreenCaptureConfiguration.Current.WindowHeight,
                Width      = ScreenCaptureConfiguration.Current.WindowWidth
            };

            Model.Window.Hide();

            form.ShowDialog();

            Model.Window.Show();
            Model.Window.Activate();

            Model.Window.Topmost = true;
            WindowUtilities.DoEvents();
            Model.Window.Topmost = false;

            if (form.Cancelled)
            {
                SetSelection("");
                return;
            }

            string capturedFile = form.SavedImageFile;

            try
            {
                capturedFile = FileUtils.GetRelativePath(capturedFile, imageFolder);
            }
            catch
            {
            }

            string relPath = capturedFile;

            if (relPath.StartsWith(".."))
            {
                relPath = form.SavedImageFile;
            }

            if (relPath.Contains(":\\")) // full path
            {
                relPath = "file:///" + relPath;
            }

            string replaceText = "![](" + relPath.Replace(" ", "%20") + ")";

            // Push the new text into the Editor's Selection
            SetSelection(replaceText);
            Model.ActiveEditor.SetEditorFocus();
            Model.Window.PreviewMarkdown(Model.ActiveEditor, true);
        }
Exemplo n.º 2
0
        public ScreenOverlayDesktop(ScreenCaptureForm screenCaptureForm)
        {
            CaptureForm = screenCaptureForm;

            InitializeComponent();

            Closing += ScreenOverlayDesktop_Closing;
        }
Exemplo n.º 3
0
 public ScreenClickOverlay(ScreenCaptureForm form)
 {
     ScreenCaptureForm = form;
     InitializeComponent();
 }