microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
110.56k stars 6.51k forks source link

[Measure Tool - ScreenRuler] Improve measurement above complex background images #20050

Open htcfreek opened 2 years ago

htcfreek commented 2 years ago

Maybe a featur to measure at one side to the nearest monitor border. (Example: You have a background that is very detailed and you want to measure the space between window and left monitor border. Then you press a key and the tool ignores the background image and enlarges the measurement until the left monitor border.) - Not sure if this is a real scenario as I can't try the tool currently

I think we could investigate changing desktop background to solid color during measurement.

Let's talk about later in a different step an create an issue for discussion.

Originally posted by @htcfreek in https://github.com/microsoft/PowerToys/pull/19701#issuecomment-1221405872


cc: @yuyoyuppe

htcfreek commented 2 years ago

In then meantime I was able to try the tool and can confirm that complex background inages are problematic. The tools detects color changes in the images and end of measure area.

yuyoyuppe commented 2 years ago

relevant apis:

https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idesktopwallpaper-setwallpaper?redirectedfrom=MSDN https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idesktopwallpaper-setbackgroundcolor

Jay-o-Way commented 2 years ago

What if the code approaches the border from the other side? In stead of going across the line that also passes over the desktop background, it could search in the other directions for a border?