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
|
@ -609,7 +609,6 @@ namespace GreenshotPlugin.Core {
|
|||
} else {
|
||||
LOG.Debug("CaptureRectangle Called!");
|
||||
}
|
||||
|
||||
// .NET GDI+ Solution, according to some post this has a GDI+ leak...
|
||||
// See http://connect.microsoft.com/VisualStudio/feedback/details/344752/gdi-object-leak-when-calling-graphics-copyfromscreen
|
||||
// Bitmap capturedBitmap = new Bitmap(captureBounds.Width, captureBounds.Height);
|
||||
|
@ -623,7 +622,7 @@ namespace GreenshotPlugin.Core {
|
|||
IntPtr hWndDesktop = User32.GetDesktopWindow();
|
||||
// get te hDC of the target window
|
||||
IntPtr hDCDesktop = User32.GetWindowDC(hWndDesktop);
|
||||
|
||||
|
||||
// Make sure the last error is set to 0
|
||||
Win32.SetLastError(0);
|
||||
|
||||
|
@ -667,7 +666,7 @@ namespace GreenshotPlugin.Core {
|
|||
|
||||
// bitblt over (make copy)
|
||||
GDI32.BitBlt(hDCDest, 0, 0, captureBounds.Width, captureBounds.Height, hDCDesktop, captureBounds.X, captureBounds.Y, CopyPixelOperation.SourceCopy | CopyPixelOperation.CaptureBlt);
|
||||
|
||||
|
||||
// restore selection (old handle)
|
||||
GDI32.SelectObject(hDCDest, hOldObject);
|
||||
// clean up
|
||||
|
@ -697,7 +696,7 @@ namespace GreenshotPlugin.Core {
|
|||
GDI32.DeleteObject(hDIBSection);
|
||||
|
||||
}
|
||||
return returnBitmap;
|
||||
}
|
||||
return returnBitmap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue