Register
RemedyBG»Forums»High DPI with scaling options
2 posts
High DPI with scaling options
1 month, 2 weeks ago Edited by tonymarklove on April 5, 2020, 2:50 p.m. Reason: Initial post
I run Windows on a 4k montior with 200% scaling enabled. It appears that RemedyBG respects the 4k resolution but not the scaling factor set in Windows. Is that the current state of things, or am I missing an option somewhere?
189 posts / 1 project

None

High DPI with scaling options
1 month, 2 weeks ago
This may not be what you mean but you can increase both the UI font size and the text font size (independently) from the Window>Style menu.

I don't have a 4k monitor to test on. Let me know if this works okay for you.

Thanks.
2 posts
High DPI with scaling options
1 month, 2 weeks ago
Yes that does work resonably well. I don't think every UI element is scaled perfectly but it is certainly usable. Thanks.

If you want to look into supporting scaling in Windows in the future, take a look at the GetDpiForWindow function. The default return value for an unscaled screen is 96. On my system, I've gone into the display settings in Windows and selected 200% scaling, and the return value is 192. So you effectively get a scaling factor (192/96 = 2) for displaying all UI elements.

I've done this myself with ImGui, so it's definitely possible with a bit of care when passing coordinates to ImGui.
189 posts / 1 project

None

High DPI with scaling options
1 month, 2 weeks ago
Cool. Thanks for the additional information!
Simon
5 posts
High DPI with scaling options
1 month, 1 week ago
I'd also really appreciate this feature!
Ryan McQuen
6 posts
High DPI with scaling options
1 month ago Edited by Ryan McQuen on April 20, 2020, 9:45 p.m. Reason: Formatting fixes.
@x13pixels, I ran into a similar issue on my project, I found that using a Manifest file embedded with mt.exe was a lot easier and cleaner than handling DPI programmatically.

https://github.com/ryanpcmcquen/b...b6f38ede3/windows/basque.manifest
https://github.com/ryanpcmcquen/b...3b67baed12ab6f38ede3/Makefile#L12

@tonymarklove, you should be able to use that Manifest with little to no modifications and add it to Remedy's .exe like so:

1
mt.exe -nologo -manifest remedybg.manifest -outputresource:remedybg.exe


If that works it should be easy enough for x13pixels to add that to the project for the next release.
189 posts / 1 project

None

High DPI with scaling options
1 month ago
Will that manifest work on Windows 7/8? The one I'm using currently using looks like:

1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
    </windowsSettings>
  </application>
</assembly>


This is embedded in remedybg.exe using the flags "/manifest:embed" and "/manifestinput:filename.manifest".

Thanks.
Ryan McQuen
6 posts
High DPI with scaling options
1 month ago Edited by Ryan McQuen on April 21, 2020, 9:46 p.m.
You'll have to test it, I don't have access to either of those enviros. According to Microsoft's docs (as far as I can tell), you can have a dpiAware setting and a dpiAwareness setting, but I got errors when implementing both. Your mileage may vary. Maybe it was because I didn't have an xmlns prop specified.
Ryan McQuen
6 posts
High DPI with scaling options
1 month ago
For reference, here is the Microsoft recommended version that never worked for me:

1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
        <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
        <dpiAware>true</dpiAware>
    </windowsSettings>
</application>
</assembly>


I'll give it another spin with that 2005 xmlns prop.

Reference:
https://docs.microsoft.com/en-us/...ess-with-the-application-manifest
Ryan McQuen
6 posts
High DPI with scaling options
1 month ago
Here's the error I get when launching:
1
The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.


Adding that xmlns prop fixes it though. Thanks @x13pixels!

https://github.com/ryanpcmcquen/b...62753c84b2b0dd32ad6595b969e315f69
Ryan McQuen
6 posts
High DPI with scaling options
1 week, 6 days ago Edited by Ryan McQuen on May 11, 2020, 5:55 p.m.
@x13pixels, did you ever try adding the dpiAwareness prop to the manifest of RemedyBG?
189 posts / 1 project

None

High DPI with scaling options
1 week, 4 days ago
I did not, sorry. Looks like that property is valid for Windows 10 v1607 and later but you can have both properties in a single manifest. I'll make this change in the next release. Thanks for reminding me.
Ryan McQuen
6 posts
High DPI with scaling options
6 days, 18 hours ago
Just saw the update, thanks!