Fix for Windows-Capture exception, which was unfortunately added when fixing a focus issue.

This commit is contained in:
RKrom 2014-12-22 21:02:57 +01:00
commit b4b6c6546d
2 changed files with 4 additions and 4 deletions

View file

@ -1245,11 +1245,12 @@ namespace Greenshot {
windowToCapture = CaptureHelper.SelectCaptureWindow(windowToCapture);
if (windowToCapture != null) {
capture = CaptureHelper.CaptureWindow(windowToCapture, capture, coreConfiguration.WindowCaptureMode);
Activate();
WindowDetails.ToForeground(Handle);
if (capture!= null && capture.Image != null) {
if (capture != null && capture.CaptureDetails != null && capture.Image != null) {
((Bitmap)capture.Image).SetResolution(capture.CaptureDetails.DpiX, capture.CaptureDetails.DpiY);
surface.AddImageContainer((Bitmap)capture.Image, 100, 100);
}
Activate();
WindowDetails.ToForeground(Handle);
}
if (capture!= null) {

View file

@ -932,7 +932,6 @@ namespace Greenshot.Helpers {
if (windowToCapture != null) {
captureForWindow.CaptureDetails.Title = windowToCapture.Text;
}
((Bitmap)captureForWindow.Image).SetResolution(captureForWindow.CaptureDetails.DpiX, captureForWindow.CaptureDetails.DpiY);
}
return captureForWindow;