falahati / WindowsDisplayAPI

WindowsDisplayAPI is a .Net wrapper for Windows Display and Windows CCD APIs
GNU Lesser General Public License v3.0
104 stars 21 forks source link

Some fields show "Identity" instead of real value #14

Closed bravo-kernel closed 4 years ago

bravo-kernel commented 4 years ago

First of all, awesome API, thank you so much ❤️.

Apologies if I'm missing something obvious here but (in some places) I'm seeing Identity as return value where I was expecting a value. For example like below, taken from the WindowsDisplaySample demo program. Using version 1.3.0.13.

All pointers appreciated.

image

bravo-kernel commented 4 years ago

OK, I guess it's left up to the API consumer to decide whether or not to translate the ENUM using e.g.

var dpiValue = (int)WindowsDisplayAPI.Native.DisplayConfig.DisplayConfigSourceDPIScale.Identity;

Which produces the expected 100.

falahati commented 4 years ago

I am using Enum types wherever possible instead of returning unknown numeric values. So that you can compare two values, serialize them effectively, and know ahead of time what values are possible or to be expected. This is one of those cases.

Since you can't change the DPI scaling to any arbitrary value; it makes sense to have an Enum type here.

bravo-kernel commented 4 years ago

Yeah, that makes total sense. Thanks for elaborating and keep up the good work !