Improve DPI support (#254)

* Improving the DPI handling for most forms, there are still issues with:
* the AboutForm.Designer.cs where the title with the version scales differently.
* the destination picker doesn't seem to scale the font correctly.
Some parts are not tested yet...

* Solved the issue with the destination picker font, and some other small issues.
There still is an issue when using Powertoys (the feature which is experimental), that the capture is somehow skipping.
This commit is contained in:
Robin Krom 2020-10-23 00:28:50 +02:00 committed by GitHub
commit 94c778d82c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 216 additions and 216 deletions

View file

@ -846,7 +846,7 @@ namespace Greenshot.Helpers {
// Restore the window making sure it's visible!
windowToCapture.Restore();
} else {
windowToCapture.ToForeground(false);
windowToCapture.ToForeground();
}
tmpCapture = windowToCapture.CaptureGdiWindow(captureForWindow);
if (tmpCapture != null) {
@ -941,7 +941,7 @@ namespace Greenshot.Helpers {
}
private void SetDpi() {
// Workaround for proble with DPI retrieval, the FromHwnd activates the window...
// Workaround for problem with DPI retrieval, the FromHwnd activates the window...
WindowDetails previouslyActiveWindow = WindowDetails.GetActiveWindow();
// Workaround for changed DPI settings in Windows 7
var mainForm = SimpleServiceProvider.Current.GetInstance<MainForm>();
@ -950,7 +950,7 @@ namespace Greenshot.Helpers {
_capture.CaptureDetails.DpiY = graphics.DpiY;
}
// Set previouslyActiveWindow as foreground window
previouslyActiveWindow?.ToForeground(false);
previouslyActiveWindow?.ToForeground();
if (_capture.CaptureDetails != null) {
((Bitmap) _capture.Image)?.SetResolution(_capture.CaptureDetails.DpiX, _capture.CaptureDetails.DpiY);
}