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); windowToCapture = CaptureHelper.SelectCaptureWindow(windowToCapture);
if (windowToCapture != null) { if (windowToCapture != null) {
capture = CaptureHelper.CaptureWindow(windowToCapture, capture, coreConfiguration.WindowCaptureMode); capture = CaptureHelper.CaptureWindow(windowToCapture, capture, coreConfiguration.WindowCaptureMode);
Activate(); if (capture != null && capture.CaptureDetails != null && capture.Image != null) {
WindowDetails.ToForeground(Handle); ((Bitmap)capture.Image).SetResolution(capture.CaptureDetails.DpiX, capture.CaptureDetails.DpiY);
if (capture!= null && capture.Image != null) {
surface.AddImageContainer((Bitmap)capture.Image, 100, 100); surface.AddImageContainer((Bitmap)capture.Image, 100, 100);
} }
Activate();
WindowDetails.ToForeground(Handle);
} }
if (capture!= null) { if (capture!= null) {

View file

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