Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scaling problems #35

Closed
squalsoft opened this issue Aug 24, 2017 · 10 comments
Closed

Scaling problems #35

squalsoft opened this issue Aug 24, 2017 · 10 comments

Comments

@squalsoft
Copy link
Contributor

On hi dpi displays it exists problems with scaling Autoupdater windows. They are very small because use old Winforms technology. It is better to change winforms to WPF windows.

@ravibpatel
Copy link
Owner

ravibpatel commented Aug 24, 2017

You are right but for now, you can handle update logic yourself and that way you can provide your own dialog.

See Handling Updates Manually for more information.

@gmichaud
Copy link
Contributor

gmichaud commented Nov 4, 2017

I spent part of last night trying to find a solution to this problem and found a relatively simple fix - all hardcoded font sizes should be changed from pixels to points in the .resx files. The scaling works properly afterwards. I did it in this commit: gmichaud@e90d7a4

There are a few other issues; one is with the icons used. The scale mode could be changed to zoom to ensure scaling but a higher resolution image has to be used otherwise it will look pixelated. The other issue I found is related to the web browser control - it doesn’t scale automatically.

@gmichaud
Copy link
Contributor

The solution does not appear to work for me. SetFont gets called after Windows Forms applies its scaling logic, and since fonts in the forms are already defined in pixels instead of points, they get scaled down: https://imgur.com/a/1jwZm

@ravibpatel
Copy link
Owner

Adding the following to Manifest file also make forms inside the library DPI-aware.

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
    </windowsSettings>
  </application>

@gmichaud
Copy link
Contributor

gmichaud commented Nov 11, 2017 via email

@ravibpatel
Copy link
Owner

ravibpatel commented Nov 11, 2017

@gmichaud Yes, It works wonders. Fonts look sharper like it works in WPF. See before and after images.

@gmichaud
Copy link
Contributor

Where did you put the manifest? At .exe level or inside the library itself? I’m using AutoUpdater as part of an Excel add-in, and Excel itself is already configured for high DPI - this is what was causing the scaling issues in the first place for me.

@ravibpatel
Copy link
Owner

@gmichaud At .exe level. In the AutoUpdaterTest project.

@ravibpatel
Copy link
Owner

ravibpatel commented Nov 12, 2017

@gmichaud Can you try the latest commit. I added new option SetProcessDPIAwareness. Can you try it for both possibilities (true and false)? To make sure how scaling behaves for Excel add-in. For WPF this works automatically and if you are using Winforms, manifest way is the best thing to do.

@gmichaud
Copy link
Contributor

Sorry for the delay. I haven't tried to play with SetProcessDPIAwareness yet but I've had reports of issues causing the buttons at the bottom of the Update form to be hidden: https://imgur.com/a/XJpaS - I was able to reproduce this by setting my local resolution to 1024x768, 100% font size.

There appears to be some interaction with Visual Studio and what's the local resolution when the form is edited. I was able to see a similar behaviour in one instance just by opening the form in a lower resolution/font size.

I found some articles on StackOverflow but I don't fully understand the problem or what's the right solution:
https://stackoverflow.com/questions/14875325/why-is-my-form-being-resized-when-it-is-displayed
https://stackoverflow.com/questions/27633483/my-windows-form-keeps-on-shrinking-resizing-on-build

AutoScaleMode=Font appears to be what's causing the automatic resize of the form. After setting a MinimumSize I did get the result I want, but i'm not sure it is the right approach.

JavierCanon pushed a commit to JavierCanon/AutoUpdater.NET that referenced this issue Aug 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants