ScreenRecorderUseActiveWindow setting not necessary anymore because region selection allows selecting client rectangle

This commit is contained in:
Jaex 2014-09-13 10:10:46 +03:00
parent bca3e1df0c
commit 248f4221e2
2 changed files with 2 additions and 39 deletions

View file

@ -55,7 +55,6 @@ public static ScreenRecordForm Instance
} }
private ScreenRecorder screenRecorder; private ScreenRecorder screenRecorder;
private Rectangle captureRectangle;
private ScreenRegionForm regionForm; private ScreenRegionForm regionForm;
private DWMManager dwmManager; private DWMManager dwmManager;
@ -73,32 +72,6 @@ private void TrayIcon_MouseClick(object sender, MouseEventArgs e)
} }
} }
private void SelectRegion()
{
TaskHelpers.SelectRegion(out captureRectangle);
}
private void ActiveWindowRegion(TaskSettings taskSettings)
{
IntPtr handle = NativeMethods.GetForegroundWindow();
if (handle.ToInt32() > 0)
{
if (taskSettings.CaptureSettings.CaptureClientArea)
{
captureRectangle = NativeMethods.GetClientRect(handle);
}
else
{
captureRectangle = CaptureHelpers.GetWindowRectangle(handle);
}
}
else
{
SelectRegion();
}
}
public void StartRecording(TaskSettings taskSettings) public void StartRecording(TaskSettings taskSettings)
{ {
if (taskSettings.CaptureSettings.RunScreencastCLI) if (taskSettings.CaptureSettings.RunScreencastCLI)
@ -144,15 +117,8 @@ public void StartRecording(TaskSettings taskSettings)
} }
} }
if (taskSettings.AdvancedSettings.ScreenRecorderUseActiveWindow) Rectangle captureRectangle;
{ TaskHelpers.SelectRegion(out captureRectangle);
ActiveWindowRegion(taskSettings);
}
else
{
SelectRegion();
}
captureRectangle = CaptureHelpers.EvenRectangleSize(captureRectangle); captureRectangle = CaptureHelpers.EvenRectangleSize(captureRectangle);
if (IsRecording || !captureRectangle.IsValid() || screenRecorder != null) if (IsRecording || !captureRectangle.IsValid() || screenRecorder != null)

View file

@ -440,9 +440,6 @@ public Size ToastWindowSize
[Category("Name pattern"), DefaultValue(50), Description("Maximum name pattern title (%t) length for file name.")] [Category("Name pattern"), DefaultValue(50), Description("Maximum name pattern title (%t) length for file name.")]
public int NamePatternMaxTitleLength { get; set; } public int NamePatternMaxTitleLength { get; set; }
[Category("Screen recorder"), DefaultValue(false), Description("Use active window region instead of showing region selection window for screen recorder.")]
public bool ScreenRecorderUseActiveWindow { get; set; }
public TaskSettingsAdvanced() public TaskSettingsAdvanced()
{ {
this.ApplyDefaultPropertyValues(); this.ApplyDefaultPropertyValues();