microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.88k stars 6.59k forks source link

A suggestion for improving the display ruler - metric units #27394

Open tshiao4695 opened 1 year ago

tshiao4695 commented 1 year ago

Description of the new feature / enhancement

I hope the pixel ruler can automatically convert the metric size when I am measuring a certain image on the monitor. It would be great if the computer could automatically recognize the size and resolution of the monitor and do the calculations without me having to manually enter the parameters. And it would be even better if the ruler for the microscope could also be simplified for ease of use.

Scenario when this would be used?

Used for calibrating microscopes and measuring one-to-one photos for e-commerce.

Supporting information

none

e-t-l commented 1 year ago

To generalize this enhancement, giving the screen ruler the option to display measurements in distance units (i.e. millimeters, inches) in addition to pixels would be extremely useful.

I believe it would require knowing not necessarily the screen resolution in terms of absolute pixel dimensions, but specifically the screen's pixel density in ppi. I'm not sure off the top of my head if this is a value that can be accessed programmatically, or whether users may have to find the number manually and enter it as a parameter. Frankly, either scenario would be perfectly acceptable.

crutkas commented 7 months ago

this won't be prefect if added. there would be a lot of detail needed to be known about the device like @e-t-l referenced

Sophanatprime commented 3 weeks ago

Some Win32 APIs can get a monitor's logical size in pixels and its real size in millimeters. Hence we can convert pixels to millimeters and vice versa. I wrote a prototype for this https://gist.github.com/Sophanatprime/3b93b2c5fd6f70313e1da13fa2f7a495. I believe it solves the problem referenced by @e-t-l. @crutkas

crutkas commented 3 weeks ago

@Sophanatprime would this be a feature you’d like to implement? Seems like you know what to do.

Sophanatprime commented 3 weeks ago

OK, I will try to implement it.