mirror of
https://github.com/greenshot/greenshot
synced 2025-07-15 01:23:47 -07:00
Fixed a possible DPI info loss
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2426 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
b17c3871a5
commit
e07278bc04
1 changed files with 9 additions and 3 deletions
|
@ -213,7 +213,7 @@ namespace Greenshot.Helpers {
|
||||||
// Workaround for changed DPI settings in Windows 7
|
// Workaround for changed DPI settings in Windows 7
|
||||||
using (Graphics graphics = Graphics.FromHwnd(MainForm.Instance.Handle)) {
|
using (Graphics graphics = Graphics.FromHwnd(MainForm.Instance.Handle)) {
|
||||||
capture.CaptureDetails.DpiX = graphics.DpiX;
|
capture.CaptureDetails.DpiX = graphics.DpiX;
|
||||||
capture.CaptureDetails.DpiY = graphics.DpiY;
|
capture.CaptureDetails.DpiY = graphics.DpiY;
|
||||||
}
|
}
|
||||||
if (previouslyActiveWindow != null) {
|
if (previouslyActiveWindow != null) {
|
||||||
// Set previouslyActiveWindow as foreground window
|
// Set previouslyActiveWindow as foreground window
|
||||||
|
@ -525,6 +525,10 @@ namespace Greenshot.Helpers {
|
||||||
// Maybe not "made" but the original is still there... somehow
|
// Maybe not "made" but the original is still there... somehow
|
||||||
outputMade = true;
|
outputMade = true;
|
||||||
} else {
|
} else {
|
||||||
|
// Make sure the resolution is set correctly!
|
||||||
|
if (capture.CaptureDetails != null && capture.Image != null) {
|
||||||
|
((Bitmap)capture.Image).SetResolution(capture.CaptureDetails.DpiX, capture.CaptureDetails.DpiY);
|
||||||
|
}
|
||||||
DoCaptureFeedback();
|
DoCaptureFeedback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -880,8 +884,10 @@ namespace Greenshot.Helpers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (captureForWindow != null && windowToCapture != null) {
|
if (captureForWindow != null) {
|
||||||
captureForWindow.CaptureDetails.Title = windowToCapture.Text;
|
if (windowToCapture != null) {
|
||||||
|
captureForWindow.CaptureDetails.Title = windowToCapture.Text;
|
||||||
|
}
|
||||||
((Bitmap)captureForWindow.Image).SetResolution(captureForWindow.CaptureDetails.DpiX, captureForWindow.CaptureDetails.DpiY);
|
((Bitmap)captureForWindow.Image).SetResolution(captureForWindow.CaptureDetails.DpiX, captureForWindow.CaptureDetails.DpiY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue