How to get Windows Display settings?
This setting is the screen DPI, or dots per inch.
Read it like so:
float dpiX, dpiY;
Graphics graphics = this.CreateGraphics();
dpiX = graphics.DpiX;
dpiY = graphics.DpiY;
I don't think it's possible at the moment for the X and Y values to be different. A value of 96 corresponds to 100% font scaling (smaller), 120 corresponds to 125% scaling (medium) and 144 corresponds to 150% scaling (larger). However, users are able to set values other than these standard ones.
Do be aware that unless your application is declared to be DPI aware, then the values you observe may be subject to DPI virtualization.
obtain Windows 10 Display settings values in Java
Found solution that seems to respect the Display settings.
javafx.geometry.Rectangle2D r = new javafx.geometry.Rectangle2D(0, 0, 1, 1);
ObservableList<Screen> screens = Screen.getScreensForRectangle(r);
if (screens != null && screens.size() > 0) {
javafx.geometry.Rectangle2D rc = screens.get(0).getBounds();
}
Related Topics
How to Set Cursor Position in Gtk -Linux, Monodevelop
Resolving Instances with ASP.NET Core Di from Within Configureservices
How to Detect the Currently Pressed Key
Compiler Ambiguous Invocation Error - Anonymous Method and Method Group with Func<> or Action
Parallel.Foreach and Async-Await
How to Move Mouse Cursor Using C#
Detecting Usb Drive Insertion and Removal Using Windows Service and C#
Object Cannot Be Cast from Dbnull to Other Types
How to Detect Installed Version of Ms-Office
How to Decompile a .Net Exe into Readable C# Source Code
Why Do Assignment Statements Return a Value
C# Switch Statement Limitations - Why
How to Merge Multiple Assemblies into One
Cross-Thread Operation Not Valid