Retrieves current settings and useful information about the monitors connected to the host computer, including pixel dimensions, physical measurements, EDID, monitor handles, and virtual screen coordinates.
Credit to Ofek Shilon for his blog posts on how to get the physical dimensions of a specific monitor using Visual C++. This is basically a C# port of his code using PInvoke, with some extra functionality added to get DPI scaling factors, physical pixel dimensions, and EDID properties.
Targets .NET Framework 4.6.1.
Create an instance of Reader
and call the GetMonitorDetails
method:
using MonitorDetails;
using MonitorDetails.Models;
...
IReader reader = new Reader();
IEnumerable<Monitor> monitors = reader.GetMonitorDetails();
...
A test console program (MonitorDetailsReader.Test
) is included that when run prints out most of the useful information for each monitor.
Monitors vary far and wide, so your mileage may vary with this reader. If you have any improvements you'd like to share, feel free to submit a pull request!
Uses EDIDParser to make sense of monitors' EDID.