Ejemplo n.º 1
0
        public static void OpenImageCombiner(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            ImageCombinerForm imageCombinerForm = new ImageCombinerForm(taskSettings.ToolsSettingsReference.ImageCombinerOptions);

            imageCombinerForm.ProcessRequested += image => UploadManager.RunImageTask(image, taskSettings);
            imageCombinerForm.Show();
        }
Ejemplo n.º 2
0
        public static void OpenScrollingCapture(TaskSettings taskSettings = null, bool forceSelection = false)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            ScrollingCaptureForm scrollingCaptureForm = new ScrollingCaptureForm(taskSettings.CaptureSettingsReference.ScrollingCaptureOptions, forceSelection);

            scrollingCaptureForm.ProcessRequested += image => UploadManager.RunImageTask(image, taskSettings);
            scrollingCaptureForm.Show();
        }
Ejemplo n.º 3
0
 public static Image AnnotateImage(Image img, string imgPath)
 {
     return(ImageHelpers.AnnotateImage(img, imgPath, !Program.IsSandbox, Program.PersonalPath,
                                       x => Program.MainForm.InvokeSafe(() => ClipboardHelpers.CopyImage(x)),
                                       x => Program.MainForm.InvokeSafe(() => UploadManager.UploadImage(x)),
                                       (x, filePath) => Program.MainForm.InvokeSafe(() => ImageHelpers.SaveImage(x, filePath)),
                                       (x, filePath) =>
     {
         string newFilePath = null;
         Program.MainForm.InvokeSafe(() => newFilePath = ImageHelpers.SaveImageFileDialog(x, filePath));
         return newFilePath;
     }));
 }
Ejemplo n.º 4
0
 public void UseCommandLineArgs(string[] args)
 {
     if (args != null && args.Length > 1)
     {
         for (int i = 1; i < args.Length; i++)
         {
             if (args[i].Equals("-clipboardupload", StringComparison.InvariantCultureIgnoreCase))
             {
                 UploadManager.ClipboardUpload();
             }
             else if (args[i][0] != '-')
             {
                 UploadManager.UploadFile(args[i]);
             }
         }
     }
 }
Ejemplo n.º 5
0
        private static void AfterCapture(Image img, CaptureType captureType, TaskSettings taskSettings)
        {
            if (img != null)
            {
                if (taskSettings.GeneralSettings.PlaySoundAfterCapture)
                {
                    TaskHelpers.PlayCaptureSound(taskSettings);
                }

                if (taskSettings.ImageSettings.ImageEffectOnlyRegionCapture && !IsRegionCapture(captureType))
                {
                    taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddImageEffects);
                }

                UploadManager.RunImageTask(img, taskSettings);
            }
        }
Ejemplo n.º 6
0
        private void TakeScreenshot()
        {
            if (!CaptureRectangle.IsEmpty)
            {
                Image img = Screenshot.CaptureRectangle(CaptureRectangle);

                if (img != null)
                {
                    TaskSettings taskSettings = TaskSettings.GetDefaultTaskSettings();
                    taskSettings.UseDefaultAfterCaptureJob             = false;
                    taskSettings.AfterCaptureJob                       = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AnnotateImage);
                    taskSettings.UseDefaultAdvancedSettings            = false;
                    taskSettings.AdvancedSettings.DisableNotifications = true;

                    UploadManager.RunImageTask(img, taskSettings);
                }
            }
        }
Ejemplo n.º 7
0
        private void TakeScreenshot()
        {
            Rectangle rect = Program.Settings.AutoCaptureRegion;

            if (!rect.IsEmpty)
            {
                Image img = TaskHelpers.GetScreenshot(TaskSettings).CaptureRectangle(rect);

                if (img != null)
                {
                    TaskSettings.UseDefaultAfterCaptureJob             = false;
                    TaskSettings.AfterCaptureJob                       = TaskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AnnotateImage);
                    TaskSettings.UseDefaultAdvancedSettings            = false;
                    TaskSettings.AdvancedSettings.DisableNotifications = true;

                    UploadManager.RunImageTask(img, TaskSettings, true, true);
                }
            }
        }
Ejemplo n.º 8
0
        private void AfterCapture(Image img, CaptureType captureType, TaskSettings taskSettings)
        {
            if (img != null)
            {
                if (taskSettings.GeneralSettings.PlaySoundAfterCapture)
                {
                    Helpers.PlaySoundAsync(Resources.CameraSound);
                }

                if (taskSettings.ImageSettings.ImageEffectOnlyRegionCapture && !IsRegionCapture(captureType))
                {
                    taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddImageEffects);
                }

                if (taskSettings.GeneralSettings.ShowAfterCaptureTasksForm)
                {
                    using (AfterCaptureForm afterCaptureForm = new AfterCaptureForm(img, taskSettings))
                    {
                        afterCaptureForm.ShowDialog();

                        switch (afterCaptureForm.Result)
                        {
                        case AfterCaptureFormResult.Continue:
                            taskSettings.AfterCaptureJob = afterCaptureForm.AfterCaptureTasks;
                            break;

                        case AfterCaptureFormResult.Copy:
                            taskSettings.AfterCaptureJob = AfterCaptureTasks.CopyImageToClipboard;
                            break;

                        case AfterCaptureFormResult.Cancel:
                            if (img != null)
                            {
                                img.Dispose();
                            }
                            return;
                        }
                    }
                }

                UploadManager.RunImageTask(img, taskSettings);
            }
        }
Ejemplo n.º 9
0
        public static void OpenWebpageCapture(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            WebpageCaptureForm webpageCaptureForm = new WebpageCaptureForm();

            webpageCaptureForm.OnImageUploadRequested += img => UploadManager.RunImageTask(img, taskSettings);
            webpageCaptureForm.OnImageCopyRequested   += img =>
            {
                using (img)
                {
                    ClipboardHelpers.CopyImage(img);
                }
            };
            webpageCaptureForm.Show();
        }
Ejemplo n.º 10
0
        public static void AnnotateImageUsingShareX(Image img, string filePath, TaskSettings taskSettings = null)
        {
            if (img == null && File.Exists(filePath))
            {
                img = ImageHelpers.LoadImage(filePath);
            }

            if (img != null)
            {
                using (img)
                {
                    RegionCaptureTasks.AnnotateImage(img, filePath, taskSettings.CaptureSettingsReference.SurfaceOptions,
                                                     x => UploadManager.RunImageTask(x, taskSettings),
                                                     (x, newFilePath) => ImageHelpers.SaveImage(x, newFilePath),
                                                     (x, newFilePath) => ImageHelpers.SaveImageFileDialog(x, newFilePath),
                                                     x => ClipboardHelpers.CopyImage(x),
                                                     x => UploadManager.UploadImage(x),
                                                     x => PrintImage(x));
                }
            }
        }
Ejemplo n.º 11
0
        private void ClipboardUpload()
        {
            if (IsClipboardContentValid)
            {
                switch (ClipboardContent)
                {
                case Bitmap bmp:
                    KeepClipboardContent = true;
                    UploadManager.ProcessImageUpload(bmp, taskSettings);
                    break;

                case string text:
                    UploadManager.ProcessTextUpload(text, taskSettings);
                    break;

                case string[] files:
                    UploadManager.ProcessFilesUpload(files, taskSettings);
                    break;
                }
            }
        }
Ejemplo n.º 12
0
        public static void OpenVideoThumbnailer(TaskSettings taskSettings = null)
        {
            if (taskSettings == null)
            {
                taskSettings = TaskSettings.GetDefaultTaskSettings();
            }

            Program.Settings.VideoThumbnailOptions.DefaultOutputDirectory = taskSettings.CaptureFolder;
            VideoThumbnailerForm thumbnailerForm = new VideoThumbnailerForm(taskSettings.CaptureSettings.FFmpegOptions.CLIPath, Program.Settings.VideoThumbnailOptions);

            thumbnailerForm.ThumbnailsTaken += thumbnails =>
            {
                if (Program.Settings.VideoThumbnailOptions.UploadThumbnails)
                {
                    foreach (VideoThumbnailInfo thumbnailInfo in thumbnails)
                    {
                        UploadManager.UploadFile(thumbnailInfo.Filepath, taskSettings);
                    }
                }
            };
            thumbnailerForm.Show();
        }
Ejemplo n.º 13
0
        public void AddWatchFolder(WatchFolderSettings watchFolderSetting, TaskSettings taskSettings)
        {
            if (!IsExist(watchFolderSetting))
            {
                if (!taskSettings.WatchFolderList.Contains(watchFolderSetting))
                {
                    taskSettings.WatchFolderList.Add(watchFolderSetting);
                }

                WatchFolder watchFolder = new WatchFolder();
                watchFolder.Settings     = watchFolderSetting;
                watchFolder.TaskSettings = taskSettings;

                watchFolder.FileWatcherTrigger += origPath =>
                {
                    TaskSettings taskSettingsCopy = TaskSettings.GetSafeTaskSettings(taskSettings);
                    string       destPath         = origPath;

                    if (watchFolderSetting.MoveFilesToScreenshotsFolder)
                    {
                        string screenshotsFolder = TaskHelpers.GetScreenshotsFolder(taskSettingsCopy);
                        string fileName          = Path.GetFileName(origPath);
                        destPath = TaskHelpers.HandleExistsFile(screenshotsFolder, fileName, taskSettingsCopy);
                        FileHelpers.CreateDirectoryFromFilePath(destPath);
                        File.Move(origPath, destPath);
                    }

                    UploadManager.UploadFile(destPath, taskSettingsCopy);
                };

                WatchFolders.Add(watchFolder);

                if (taskSettings.WatchFolderEnabled)
                {
                    watchFolder.Enable();
                }
            }
        }
Ejemplo n.º 14
0
        private void TakeScreenshot()
        {
            Rectangle rect = Program.Settings.AutoCaptureRegion;

            if (!rect.IsEmpty)
            {
                CaptureRectangle cr = new CaptureRectangle();
                cr.setRectangle(rect);

                Image img = cr.Screenshot();

                if (img != null)
                {
                    TaskSettings taskSettings = TaskSettings.GetDefaultTaskSettings();
                    taskSettings.UseDefaultAfterCaptureJob             = false;
                    taskSettings.AfterCaptureJob                       = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AnnotateImage);
                    taskSettings.UseDefaultAdvancedSettings            = false;
                    taskSettings.AdvancedSettings.DisableNotifications = true;

                    UploadManager.RunImageTask(img, taskSettings);
                }
            }
        }
Ejemplo n.º 15
0
        private static void AfterCapture(ImageInfo imageInfo, CaptureType captureType, TaskSettings taskSettings)
        {
            if (imageInfo != null && imageInfo.Image != null)
            {
                if (taskSettings.GeneralSettings.PlaySoundAfterCapture)
                {
                    TaskHelpers.PlayCaptureSound(taskSettings);
                }

                if (taskSettings.AdvancedSettings.UseShareXForAnnotation && taskSettings.AfterCaptureJob.HasFlag(AfterCaptureTasks.AnnotateImage) &&
                    captureType == CaptureType.Region)
                {
                    taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AnnotateImage);
                }

                if (taskSettings.ImageSettings.ImageEffectOnlyRegionCapture && !IsRegionCapture(captureType))
                {
                    taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddImageEffects);
                }

                UploadManager.RunImageTask(imageInfo, taskSettings);
            }
        }
Ejemplo n.º 16
0
        private void AfterCapture(ImageInfo imageInfo, TaskSettings taskSettings)
        {
            if (imageInfo != null && imageInfo.Image != null)
            {
                if (taskSettings.GeneralSettings.PlaySoundAfterCapture)
                {
                    TaskHelpers.PlayCaptureSound(taskSettings);
                }

                if (taskSettings.AfterCaptureJob.HasFlag(AfterCaptureTasks.AnnotateImage) && !AllowAnnotation)
                {
                    taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AnnotateImage);
                }

                if (taskSettings.ImageSettings.ImageEffectOnlyRegionCapture &&
                    this.GetType() != typeof(CaptureRegion) && this.GetType() != typeof(CaptureLastRegion))
                {
                    taskSettings.AfterCaptureJob = taskSettings.AfterCaptureJob.Remove(AfterCaptureTasks.AddImageEffects);
                }

                UploadManager.RunImageTask(imageInfo, taskSettings);
            }
        }
Ejemplo n.º 17
0
        private void NotificationForm_MouseClick(object sender, MouseEventArgs e)
        {
            tDuration.Stop();

            Close();

            if (e.Button == MouseButtons.Left)
            {
                switch (ToastConfig.Action)
                {
                case ToastClickAction.AnnotateImage:
                    if (!string.IsNullOrEmpty(ToastConfig.FilePath) && Helpers.IsImageFile(ToastConfig.FilePath))
                    {
                        TaskHelpers.AnnotateImageFromFile(ToastConfig.FilePath);
                    }
                    break;

                case ToastClickAction.CopyImageToClipboard:
                    if (!string.IsNullOrEmpty(ToastConfig.FilePath))
                    {
                        ClipboardHelpers.CopyImageFromFile(ToastConfig.FilePath);
                    }
                    break;

                case ToastClickAction.CopyUrl:
                    if (!string.IsNullOrEmpty(ToastConfig.URL))
                    {
                        ClipboardHelpers.CopyText(ToastConfig.URL);
                    }
                    break;

                case ToastClickAction.OpenFile:
                    if (!string.IsNullOrEmpty(ToastConfig.FilePath))
                    {
                        URLHelpers.OpenURL(ToastConfig.FilePath);
                    }
                    break;

                case ToastClickAction.OpenFolder:
                    if (!string.IsNullOrEmpty(ToastConfig.FilePath))
                    {
                        Helpers.OpenFolderWithFile(ToastConfig.FilePath);
                    }
                    break;

                case ToastClickAction.OpenUrl:
                    if (!string.IsNullOrEmpty(ToastConfig.URL))
                    {
                        URLHelpers.OpenURL(ToastConfig.URL);
                    }
                    break;

                case ToastClickAction.Upload:
                    if (!string.IsNullOrEmpty(ToastConfig.FilePath))
                    {
                        UploadManager.UploadFile(ToastConfig.FilePath);
                    }
                    break;
                }
            }
        }
Ejemplo n.º 18
0
        public async void StartRecording(TaskSettings TaskSettings)
        {
            if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.AVICommandLine)
            {
                if (!Program.Settings.VideoEncoders.IsValidIndex(TaskSettings.CaptureSettings.VideoEncoderSelected))
                {
                    MessageBox.Show("There is no valid CLI video encoder selected.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else if (!Program.Settings.VideoEncoders[TaskSettings.CaptureSettings.VideoEncoderSelected].IsValid())
                {
                    MessageBox.Show("There is a problem with the CLI video encoder file path.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
            }

            SelectRegion();
            Screenshot.CaptureCursor = TaskSettings.CaptureSettings.ShowCursor;

            if (IsRecording || CaptureRectangle.IsEmpty || screenRecorder != null)
            {
                return;
            }

            IsRecording = true;

            TrayIcon.Icon    = Resources.control_record_yellow.ToIcon();
            TrayIcon.Visible = true;

            string path = "";

            try
            {
                using (ScreenRegionManager screenRegionManager = new ScreenRegionManager())
                {
                    screenRegionManager.Start(CaptureRectangle);

                    await TaskEx.Run(() =>
                    {
                        if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.AVI)
                        {
                            path = Path.Combine(TaskSettings.CaptureFolder, TaskHelpers.GetFilename(TaskSettings, "avi"));
                        }
                        else
                        {
                            path = Program.ScreenRecorderCacheFilePath;
                        }

                        float duration = TaskSettings.CaptureSettings.ScreenRecordFixedDuration ? TaskSettings.CaptureSettings.ScreenRecordDuration : 0;

                        screenRecorder = new ScreenRecorder(TaskSettings.CaptureSettings.ScreenRecordFPS, duration, CaptureRectangle, path,
                                                            TaskSettings.CaptureSettings.ScreenRecordOutput);

                        int delay = (int)(TaskSettings.CaptureSettings.ScreenRecordStartDelay * 1000);

                        if (delay > 0)
                        {
                            Thread.Sleep(delay);
                        }

                        screenRegionManager.ChangeColor();

                        this.InvokeSafe(() => TrayIcon.Icon = Resources.control_record.ToIcon());

                        screenRecorder.StartRecording();
                    });
                }

                if (screenRecorder != null && TaskSettings.CaptureSettings.ScreenRecordOutput != ScreenRecordOutput.AVI)
                {
                    TrayIcon.Icon = Resources.camcorder__pencil.ToIcon();

                    await TaskEx.Run(() =>
                    {
                        switch (TaskSettings.CaptureSettings.ScreenRecordOutput)
                        {
                        case ScreenRecordOutput.GIF:
                            path = Path.Combine(TaskSettings.CaptureFolder, TaskHelpers.GetFilename(TaskSettings, "gif"));
                            screenRecorder.SaveAsGIF(path, TaskSettings.ImageSettings.ImageGIFQuality);
                            break;

                        case ScreenRecordOutput.AVICommandLine:
                            VideoEncoder encoder = Program.Settings.VideoEncoders[TaskSettings.CaptureSettings.VideoEncoderSelected];
                            path = Path.Combine(TaskSettings.CaptureFolder, TaskHelpers.GetFilename(TaskSettings, encoder.OutputExtension));
                            screenRecorder.EncodeUsingCommandLine(encoder, path);
                            break;
                        }
                    });
                }
            }
            finally
            {
                if (screenRecorder != null)
                {
                    if (TaskSettings.CaptureSettings.ScreenRecordOutput == ScreenRecordOutput.AVICommandLine &&
                        !string.IsNullOrEmpty(screenRecorder.CachePath) && File.Exists(screenRecorder.CachePath))
                    {
                        File.Delete(screenRecorder.CachePath);
                    }

                    screenRecorder.Dispose();
                    screenRecorder = null;
                }

                if (TrayIcon.Visible)
                {
                    TrayIcon.Visible = false;
                }
            }

            if (!string.IsNullOrEmpty(path) && File.Exists(path))
            {
                if (TaskSettings.AfterCaptureJob.HasFlag(AfterCaptureTasks.UploadImageToHost))
                {
                    UploadManager.UploadFile(path, TaskSettings);
                }
                else
                {
                    if (TaskSettings.AfterCaptureJob.HasFlag(AfterCaptureTasks.CopyFilePathToClipboard))
                    {
                        ClipboardHelpers.CopyText(path);
                    }

                    TaskHelpers.ShowResultNotifications(path, TaskSettings, path);
                }
            }

            IsRecording = false;
        }
Ejemplo n.º 19
0
 private void tsmiTestURLShortener_Click(object sender, EventArgs e)
 {
     UploadManager.ShortenURL(Links.URL_WEBSITE);
 }
Ejemplo n.º 20
0
 private void tsmiTestFileUpload_Click(object sender, EventArgs e)
 {
     UploadManager.UploadImage(Resources.Test, ImageDestination.FileUploader);
 }
Ejemplo n.º 21
0
 private void tsmiTestTextUpload_Click(object sender, EventArgs e)
 {
     UploadManager.UploadText("Text upload test");
 }
Ejemplo n.º 22
0
 private void tsmiTestImageUpload_Click(object sender, EventArgs e)
 {
     UploadManager.RunImageTask(Resources.Test);
 }
Ejemplo n.º 23
0
 private void tsbFileUpload_Click(object sender, EventArgs e)
 {
     UploadManager.UploadFile();
 }
Ejemplo n.º 24
0
 private void tsbClipboardUpload_Click(object sender, EventArgs e)
 {
     UploadManager.ClipboardUploadMainWindow();
 }
Ejemplo n.º 25
0
 private void MainForm_DragDrop(object sender, DragEventArgs e)
 {
     UploadManager.DragDropUpload(e.Data);
 }
Ejemplo n.º 26
0
 private void ActionsToolbarForm_DragDrop(object sender, DragEventArgs e)
 {
     UploadManager.DragDropUpload(e.Data);
 }
Ejemplo n.º 27
0
        private void ExecuteAction(ToastClickAction action)
        {
            switch (action)
            {
            case ToastClickAction.AnnotateImage:
                if (!string.IsNullOrEmpty(Config.FilePath) && Helpers.IsImageFile(Config.FilePath))
                {
                    TaskHelpers.AnnotateImageFromFile(Config.FilePath);
                }
                break;

            case ToastClickAction.CopyImageToClipboard:
                if (!string.IsNullOrEmpty(Config.FilePath))
                {
                    ClipboardHelpers.CopyImageFromFile(Config.FilePath);
                }
                break;

            case ToastClickAction.CopyFile:
                if (!string.IsNullOrEmpty(Config.FilePath))
                {
                    ClipboardHelpers.CopyFile(Config.FilePath);
                }
                break;

            case ToastClickAction.CopyFilePath:
                if (!string.IsNullOrEmpty(Config.FilePath))
                {
                    ClipboardHelpers.CopyText(Config.FilePath);
                }
                break;

            case ToastClickAction.CopyUrl:
                if (!string.IsNullOrEmpty(Config.URL))
                {
                    ClipboardHelpers.CopyText(Config.URL);
                }
                break;

            case ToastClickAction.OpenFile:
                if (!string.IsNullOrEmpty(Config.FilePath))
                {
                    Helpers.OpenFile(Config.FilePath);
                }
                break;

            case ToastClickAction.OpenFolder:
                if (!string.IsNullOrEmpty(Config.FilePath))
                {
                    Helpers.OpenFolderWithFile(Config.FilePath);
                }
                break;

            case ToastClickAction.OpenUrl:
                if (!string.IsNullOrEmpty(Config.URL))
                {
                    URLHelpers.OpenURL(Config.URL);
                }
                break;

            case ToastClickAction.Upload:
                if (!string.IsNullOrEmpty(Config.FilePath))
                {
                    UploadManager.UploadFile(Config.FilePath);
                }
                break;
            }
        }
Ejemplo n.º 28
0
        private void HandleTask(TaskSettings taskSettings)
        {
            TaskSettings safeTaskSettings = TaskSettings.GetSafeTaskSettings(taskSettings);

            switch (safeTaskSettings.Job)
            {
            case HotkeyType.StopUploads:
                TaskManager.StopAllTasks();
                break;

            case HotkeyType.ClipboardUpload:
                UploadManager.ClipboardUpload(safeTaskSettings);
                break;

            case HotkeyType.ClipboardUploadWithContentViewer:
                UploadManager.ClipboardUploadWithContentViewer(safeTaskSettings);
                break;

            case HotkeyType.FileUpload:
                UploadManager.UploadFile(safeTaskSettings);
                break;

            case HotkeyType.DragDropUpload:
                TaskHelpers.OpenDropWindow();
                break;

            case HotkeyType.PrintScreen:
                CaptureScreenshot(CaptureType.Screen, safeTaskSettings, false);
                break;

            case HotkeyType.ActiveWindow:
                CaptureScreenshot(CaptureType.ActiveWindow, safeTaskSettings, false);
                break;

            case HotkeyType.ActiveMonitor:
                CaptureScreenshot(CaptureType.ActiveMonitor, safeTaskSettings, false);
                break;

            case HotkeyType.RectangleRegion:
                CaptureScreenshot(CaptureType.Rectangle, safeTaskSettings, false);
                break;

            case HotkeyType.WindowRectangle:
                CaptureScreenshot(CaptureType.RectangleWindow, safeTaskSettings, false);
                break;

            case HotkeyType.RoundedRectangleRegion:
                CaptureScreenshot(CaptureType.RoundedRectangle, safeTaskSettings, false);
                break;

            case HotkeyType.EllipseRegion:
                CaptureScreenshot(CaptureType.Ellipse, safeTaskSettings, false);
                break;

            case HotkeyType.TriangleRegion:
                CaptureScreenshot(CaptureType.Triangle, safeTaskSettings, false);
                break;

            case HotkeyType.DiamondRegion:
                CaptureScreenshot(CaptureType.Diamond, safeTaskSettings, false);
                break;

            case HotkeyType.PolygonRegion:
                CaptureScreenshot(CaptureType.Polygon, safeTaskSettings, false);
                break;

            case HotkeyType.FreeHandRegion:
                CaptureScreenshot(CaptureType.Freehand, safeTaskSettings, false);
                break;

            case HotkeyType.LastRegion:
                CaptureScreenshot(CaptureType.LastRegion, safeTaskSettings, false);
                break;

            case HotkeyType.ScreenRecorder:
                TaskHelpers.DoScreenRecorder(safeTaskSettings);
                break;

            case HotkeyType.AutoCapture:
                TaskHelpers.OpenAutoCapture();
                break;

            case HotkeyType.ScreenColorPicker:
                TaskHelpers.OpenScreenColorPicker(safeTaskSettings);
                break;

            case HotkeyType.Ruler:
                TaskHelpers.OpenRuler();
                break;

            case HotkeyType.FTPClient:
                TaskHelpers.OpenFTPClient();
                break;

            case HotkeyType.HashCheck:
                TaskHelpers.OpenHashCheck();
                break;

            case HotkeyType.IndexFolder:
                TaskHelpers.OpenIndexFolder();
                break;

            case HotkeyType.ImageEffects:
                TaskHelpers.OpenImageEffects();
                break;

            case HotkeyType.QRCode:
                TaskHelpers.OpenQRCode();
                break;
            }
        }
Ejemplo n.º 29
0
 public static void OpenIndexFolder()
 {
     UploadManager.IndexFolder();
 }
Ejemplo n.º 30
0
 public static Image AnnotateImage(Image img)
 {
     return(ImageHelpers.AnnotateImage(img, !Program.IsSandbox, Program.PersonalPath,
                                       x => Program.MainForm.InvokeSafe(() => ClipboardHelpers.CopyImage(x)),
                                       x => Program.MainForm.InvokeSafe(() => UploadManager.RunImageTask(x))));
 }