Fixes for better performance in some experimental code, also fixed some formatting in the code.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2287 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-11-15 14:11:00 +00:00
parent fa02394047
commit 75a841b31e
6 changed files with 72 additions and 24 deletions

View file

@ -45,7 +45,7 @@ namespace Greenshot.Helpers {
public class CaptureHelper {
private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(CaptureHelper));
private static CoreConfiguration conf = IniConfig.GetIniSection<CoreConfiguration>();
//private static ScreenCaptureHelper screenCapture = null;
private static ScreenCaptureHelper screenCapture = null;
private List<WindowDetails> windows = new List<WindowDetails>();
private WindowDetails selectedCaptureWindow = null;
private Rectangle captureRect = Rectangle.Empty;
@ -160,6 +160,12 @@ namespace Greenshot.Helpers {
/// Make Capture with specified destinations
/// </summary>
private void MakeCapture() {
// Experimental code
if (screenCapture != null) {
screenCapture.Stop();
screenCapture = null;
return;
}
// This fixes a problem when a balloon is still visible and a capture needs to be taken
// forcefully removes the balloon!
if (!conf.HideTrayicon) {
@ -892,6 +898,24 @@ namespace Greenshot.Helpers {
// windowDetailsThread.Join();
//}
// Experimental code for Video capture
if (capture.CaptureDetails.CaptureMode == CaptureMode.Video) {
if (captureForm.UsedCaptureMode == CaptureMode.Window) {
screenCapture = new ScreenCaptureHelper(selectedCaptureWindow);
} else if (captureForm.UsedCaptureMode == CaptureMode.Region) {
screenCapture = new ScreenCaptureHelper(captureRect);
}
if (screenCapture != null) {
screenCapture.RecordMouse = capture.CursorVisible;
if (screenCapture.Start(25)) {
return;
}
// User clicked cancel or a problem occured
screenCapture.Stop();
screenCapture = null;
return;
}
}
// Take the captureRect, this already is specified as bitmap coordinates
capture.Crop(captureRect);