Skip to content

A WPF application to get system DPI and per-monitor DPI.

Notifications You must be signed in to change notification settings

huxiang/dpi_monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

This project creates a WPF application which can detect system DPI, per-Monitor DPI.

Pre-requisites

  • .Net Framework 4.6.2 or later

Note: Per-Monitor DPI awareness is a windows feature, it requires Windows 10 1607 and later.

How to Use

Just run the compiled executable file, it will show you:

  • System DPI
  • Current window DPI (for this application)
  • per-Monitor DPI for every monitor

At same time, it writes output to %TEMP%\DPIMonitor.json file in below format:

{
   "CurrentWindowDpi": 96,
   "Monitors": [
      {
         "DisplayName": "\\\\.\\DISPLAY1",
         "Dpi": 96
      },
      {
         "DisplayName": "\\\\.\\DISPLAY2",
         "Dpi": 96
      }
   ],
   "SystemDpi": 96
}

You can read this file by any other programming language for your automation testing.

DPI results on the application window and the %TEMP%\DPIMonitor.json file will be updated immedately on below events:

  • DPI of the screen which this application is running on changed. For example, you change the DPI from Settings manually; you drag and drop the window of this application to another screen which has different DPI.

  • Window size of this application changed.

So it's also useful for manual testing.

Known Issues

Issue 1

Problem: In multi-monitor environment, if this application is running on Monitor 1, you changed DPI of Monitor 2. The DPI results will not be updated.

Workaround: Resize the window of this application or restart this application.

About

A WPF application to get system DPI and per-monitor DPI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages