mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Performance improvements, disabled a not used feature.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2102 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
42e6375d9e
commit
be3df25804
1 changed files with 30 additions and 18 deletions
|
@ -169,8 +169,19 @@ namespace Greenshot.Helpers {
|
||||||
LOG.Debug(String.Format("Capturing with mode {0} and using Cursor {1}", captureMode, captureMouseCursor));
|
LOG.Debug(String.Format("Capturing with mode {0} and using Cursor {1}", captureMode, captureMouseCursor));
|
||||||
capture.CaptureDetails.CaptureMode = captureMode;
|
capture.CaptureDetails.CaptureMode = captureMode;
|
||||||
|
|
||||||
// Get the windows details in a seperate thread
|
// Get the windows details in a seperate thread, only for those captures that have a Feedback
|
||||||
windowDetailsThread = PrepareForCaptureWithFeedback();
|
// As currently the "elements" aren't used, we don't need them yet
|
||||||
|
switch (captureMode) {
|
||||||
|
case CaptureMode.Region:
|
||||||
|
// Check if a region is pre-supplied!
|
||||||
|
if (Rectangle.Empty.Equals(captureRect)) {
|
||||||
|
windowDetailsThread = PrepareForCaptureWithFeedback();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CaptureMode.Window:
|
||||||
|
windowDetailsThread = PrepareForCaptureWithFeedback();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Add destinations if no-one passed a handler
|
// Add destinations if no-one passed a handler
|
||||||
if (capture.CaptureDetails.CaptureDestinations == null || capture.CaptureDetails.CaptureDestinations.Count == 0) {
|
if (capture.CaptureDetails.CaptureDestinations == null || capture.CaptureDetails.CaptureDestinations.Count == 0) {
|
||||||
|
@ -421,23 +432,24 @@ namespace Greenshot.Helpers {
|
||||||
lock (windows) {
|
lock (windows) {
|
||||||
windows.Add(window);
|
windows.Add(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get window rectangle as capture Element
|
// TODO: Following code should be enabled & checked if the editor can support "elements"
|
||||||
CaptureElement windowCaptureElement = new CaptureElement(windowRectangle);
|
//// Get window rectangle as capture Element
|
||||||
if (capture == null) {
|
//CaptureElement windowCaptureElement = new CaptureElement(windowRectangle);
|
||||||
break;
|
//if (capture == null) {
|
||||||
}
|
// break;
|
||||||
capture.Elements.Add(windowCaptureElement);
|
//}
|
||||||
|
//capture.Elements.Add(windowCaptureElement);
|
||||||
|
|
||||||
if (!window.HasParent) {
|
//if (!window.HasParent) {
|
||||||
// Get window client rectangle as capture Element, place all the other "children" in there
|
// // Get window client rectangle as capture Element, place all the other "children" in there
|
||||||
Rectangle clientRectangle = window.ClientRectangle;
|
// Rectangle clientRectangle = window.ClientRectangle;
|
||||||
CaptureElement windowClientCaptureElement = new CaptureElement(clientRectangle);
|
// CaptureElement windowClientCaptureElement = new CaptureElement(clientRectangle);
|
||||||
windowCaptureElement.Children.Add(windowClientCaptureElement);
|
// windowCaptureElement.Children.Add(windowClientCaptureElement);
|
||||||
AddCaptureElementsForWindow(windowClientCaptureElement, window, goLevelDeep);
|
// AddCaptureElementsForWindow(windowClientCaptureElement, window, goLevelDeep);
|
||||||
} else {
|
//} else {
|
||||||
AddCaptureElementsForWindow(windowCaptureElement, window, goLevelDeep);
|
// AddCaptureElementsForWindow(windowCaptureElement, window, goLevelDeep);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
lock (windows) {
|
lock (windows) {
|
||||||
windows = WindowDetails.SortByZOrder(IntPtr.Zero, windows);
|
windows = WindowDetails.SortByZOrder(IntPtr.Zero, windows);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue