mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
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:
parent
fa02394047
commit
75a841b31e
6 changed files with 72 additions and 24 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue