From e29bb9bf068bf23edab39c9e9cedfc2468e71b64 Mon Sep 17 00:00:00 2001 From: Jaex Date: Sat, 4 Apr 2015 21:32:27 +0300 Subject: [PATCH] fixed #600: Clean GIF cache file --- ShareX.HelpersLib/Properties/Resources.Designer.cs | 9 +++++++++ ShareX.HelpersLib/Properties/Resources.resx | 3 +++ ShareX.ScreenCaptureLib/Forms/RectangleTransparent.cs | 11 ++++++++++- ShareX/Forms/ScreenRecordForm.cs | 3 ++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/ShareX.HelpersLib/Properties/Resources.Designer.cs b/ShareX.HelpersLib/Properties/Resources.Designer.cs index 4962a3742..4439ce113 100644 --- a/ShareX.HelpersLib/Properties/Resources.Designer.cs +++ b/ShareX.HelpersLib/Properties/Resources.Designer.cs @@ -915,6 +915,15 @@ internal static string HotkeyType_RectangleRegion { } } + /// + /// Looks up a localized string similar to Capture rectangle region (Transparent). + /// + internal static string HotkeyType_RectangleTransparent { + get { + return ResourceManager.GetString("HotkeyType_RectangleTransparent", resourceCulture); + } + } + /// /// Looks up a localized string similar to Capture rounded rectangle region. /// diff --git a/ShareX.HelpersLib/Properties/Resources.resx b/ShareX.HelpersLib/Properties/Resources.resx index f9cff0f1e..0f9cb96b9 100644 --- a/ShareX.HelpersLib/Properties/Resources.resx +++ b/ShareX.HelpersLib/Properties/Resources.resx @@ -631,4 +631,7 @@ Would you like to download and install it? Open/Stop Automate tool + + Capture rectangle region (Transparent) + \ No newline at end of file diff --git a/ShareX.ScreenCaptureLib/Forms/RectangleTransparent.cs b/ShareX.ScreenCaptureLib/Forms/RectangleTransparent.cs index 503fe57d7..76134b4a4 100644 --- a/ShareX.ScreenCaptureLib/Forms/RectangleTransparent.cs +++ b/ShareX.ScreenCaptureLib/Forms/RectangleTransparent.cs @@ -192,7 +192,16 @@ private void timer_Tick(object sender, EventArgs e) PreviousSelectionRectangle = SelectionRectangle; SelectionRectangle = CaptureHelpers.CreateRectangle(positionOnClick.X, positionOnClick.Y, currentPosition.X, currentPosition.Y); - RefreshSurface(); + try + { + RefreshSurface(); + } + catch (Exception ex) + { +#if DEBUG + MessageBox.Show(ex.ToString()); +#endif + } } private void RefreshSurface() diff --git a/ShareX/Forms/ScreenRecordForm.cs b/ShareX/Forms/ScreenRecordForm.cs index 11964f58d..cbec25588 100644 --- a/ShareX/Forms/ScreenRecordForm.cs +++ b/ShareX/Forms/ScreenRecordForm.cs @@ -299,7 +299,8 @@ public void StartRecording(ScreenRecordOutput outputType, TaskSettings taskSetti { if (screenRecorder != null) { - if (taskSettings.CaptureSettings.RunScreencastCLI && !string.IsNullOrEmpty(screenRecorder.CachePath) && File.Exists(screenRecorder.CachePath)) + if ((outputType == ScreenRecordOutput.GIF || taskSettings.CaptureSettings.RunScreencastCLI) && + !string.IsNullOrEmpty(screenRecorder.CachePath) && File.Exists(screenRecorder.CachePath)) { File.Delete(screenRecorder.CachePath); }