[New PowerToy] Add Screen Ruler module for measuring screen contents (#19701)

* [MeasureTool] initial commit

* [chore] clean up needless WindowsTargetPlatformVersion overrides from projects

* [MeasureTool] initial implementation

* Fix build errors

* Update vsconfig for needed Windows 10 SDK versions

* fix spellchecker

* another spellcheck fix

* more spellcheck errors

* Fix measurement being off by 1 on both ends

* UI fixes

* Add feet to crosses

* Remove anti-aliasing, as it's creating artifacts

* Use pixel tolerance from settings

* Tooltip updates

* Restore antialiasing to draw the tooltip

* remove comment for spell check

* Updated icons

* Icon updates

* Improve measurement accuracy and display

* Fix spellchecker

* Add less precise drawing on continuous warning

* Add setting for turning cross feet on

* Swap LMB/RMB for interaction

* Uncheck active tool's RadioButton when it exits

* activation hotkey toggles UI instead of just launching it

* track runner process and exit when it exits

* add proj ref

* toolbar is interactive during measurements

* always open toolbar on the main display

* refactor colors

* refactor edge detection & overlay ui

* refactor overlay ui even more

* simplify state structs

* multimonitor preparation: eliminate global state

* prepare for merge

* spelling

* proper thread termination + minor fixes

* multimonitor: launch tools on all monitors

* multimonitor support: track cursor position

* spell

* fix powertoys!

* ScreenSize -> Box

* add shadow effect for textbox

* spell

* fix debug mode

* dynamic text box size based on text layout metrics

* add mouse wheel to adjust pixel tolerance + per channel detection algorithm setting

* spelling

* fix per channel distance calculations

* update installer deps + spelling

* tool activation telemetry

* update assets and try to fix build

* use × instead of x

* allow multiple measurements with bounds tool with shift-click

* move #define DEBUG_OVERLAY in an appropriate space

* spell-checked

* update issue template + refactor text box drawing

* implement custom renderer and make × semiopaque

* spelling

* pass dpiScale to x renderer

* add sse2neon license

* update OOBE

* move license to NOTICE

* appropriate module preview image

* localization for AutomationPeer

* increase default pixel tolerance from 5 to 30

* add PowerToys.MeasureToolUI.exe to bugreport

* explicitly set texture dims

* clarify continuous capture description

* fix a real spelling error!

* cleanup

* clean up x2

* debug texture

* fix texture access

* fix saveasbitmap

* improve sum of all channel diffs method score calc

* optimize

* ContinuousCapture is enabled by default to avoid confusion

* build fix

* draw captured screen in a non continuous mode

* cast a spell...

* merge fix

* disable stroboscopic effect

* split global/perScreen measure state and minor improvements

* spelling

* fix comment

* primary monitor debug also active for the bounds tool

* dpi from rt for custom renderer

* add comment

* fix off by 1

* make backround convertion success for non continuous mode non-essential

* fix spelling

* overlay window covers taskbar

* fix CI

* revert taskbar covering

* fix CI

* fix ci again

* fix 2

* fix ci

* CI fix

* fix arm ci

* cleanup cursor convertion between coordinate spaces

* fix spelling

* Fix signing

* Fix MeasureToolUI version

* Fix core version

* fix race condition in system internals which happens during concurrent d3d/d2d resource creation

Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
This commit is contained in:
Andrey Nekrasov
2022-08-27 02:17:20 +03:00
committed by GitHub
parent 2274e0c67d
commit 78d65a87cd
114 changed files with 5319 additions and 337 deletions

View File

@@ -121,6 +121,61 @@
<value>Video Conference Mute</value>
<comment>Navigation view item name for Video Conference</comment>
</data>
<data name="Shell_MeasureTool.Content" xml:space="preserve">
<value>Screen Ruler</value>
<comment>Product name: Navigation view item name for Screen Ruler</comment>
</data>
<data name="MeasureTool.ModuleDescription" xml:space="preserve">
<value>Screen Ruler is a quick and easy way to measure pixels on your screen.
Inspired by Roolr.</value>
<comment>"Screen Ruler" is the name of the utility</comment>
</data>
<data name="MeasureTool.ModuleTitle" xml:space="preserve">
<value>Screen Ruler</value>
<comment>"Screen Ruler" is the name of the utility</comment>
</data>
<data name="MeasureTool_ActivationSettings.Header" xml:space="preserve">
<value>Activation</value>
</data>
<data name="MeasureTool_Settings.Header" xml:space="preserve">
<value>Behavior</value>
<comment>"Screen Ruler" is the name of the utility</comment>
</data>
<data name="MeasureTool_ActivationShortcut.Header" xml:space="preserve">
<value>Activation shortcut</value>
</data>
<data name="MeasureTool_ActivationShortcut.Description" xml:space="preserve">
<value>Customize the shortcut to bring up the command bar</value>
<comment>"Screen Ruler" is the name of the utility</comment>
</data>
<data name="MeasureTool_PixelTolerance.Header" xml:space="preserve">
<value>Pixel tolerance for edge detection</value>
</data>
<data name="MeasureTool_MeasureCrossColor.Header" xml:space="preserve">
<value>Line color</value>
</data>
<data name="MeasureTool_ContinuousCapture.Header" xml:space="preserve">
<value>Capture screen continuously during measuring</value>
</data>
<data name="MeasureTool_ContinuousCapture.Description" xml:space="preserve">
<value>Refresh screen contexts in real-time instead of making a screenshot once. If enabled, tracing is slightly offset from the cursor position to not intersect with previously rendered cross lines.</value>
</data>
<data name="MeasureTool_PerColorChannelEdgeDetection.Header" xml:space="preserve">
<value>Per color channel edge detection</value>
</data>
<data name="MeasureTool_PerColorChannelEdgeDetection.Description" xml:space="preserve">
<value>If enabled, test that all color channels are within a tolerance distance from each other. Otherwise, check that the sum of all color channels differences is smaller than the tolerance.</value>
</data>
<data name="MeasureTool_DrawFeetOnCross.Header" xml:space="preserve">
<value>Draw feet on cross</value>
</data>
<data name="MeasureTool_DrawFeetOnCross.Description" xml:space="preserve">
<value>Adds feet to the end of cross lines. Always off for continuous capture.</value>
</data>
<data name="MeasureTool_EnableMeasureTool.Header" xml:space="preserve">
<value>Enable Screen Ruler</value>
<comment>"Screen Ruler" is the name of the utility</comment>
</data>
<data name="VideoConference_Enable.Header" xml:space="preserve">
<value>Enable Video Conference Mute</value>
</data>
@@ -1364,6 +1419,9 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
</data>
<data name="Oobe_Run.Description" xml:space="preserve">
<value>PowerToys Run is a quick launcher for power users that contains some additional features without sacrificing performance.</value>
</data>
<data name="Oobe_MeasureTool.Description" xml:space="preserve">
<value>Screen Ruler is a quick and easy way to measure pixels on your screen.</value>
</data>
<data name="Oobe_ShortcutGuide.Description" xml:space="preserve">
<value>Shortcut Guide presents the user with a listing of available shortcuts for the current state of the desktop.</value>
@@ -1456,6 +1514,16 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="Oobe_VideoConference_ToggleVid.Text" xml:space="preserve">
<value>to toggle your video</value>
</data>
<data name="Oobe_MeasureTool_Activation.Text" xml:space="preserve">
<value>to bring up the Screen Ruler command bar.</value>
</data>
<data name="Oobe_MeasureTool_HowToLaunch.Text" xml:space="preserve">
<value>The Bounds mode lets you select a specific area to measure. You can also shift-drag an area to persist in on screen. The various Spacing modes allows tracing similar pixels along horizontal and vertical axes with a customizable pixel tolerance threshold (use settings or mouse wheel to adjust it).</value>
</data>
<data name="Oobe_MeasureTool.Title" xml:space="preserve">
<value>Screen Ruler</value>
<comment>Do not localize this string</comment>
</data>
<data name="Oobe_ColorPicker.Title" xml:space="preserve">
<value>Color Picker</value>
<comment>Do not localize this string</comment>
@@ -1698,6 +1766,10 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="LearnMore_Run.Text" xml:space="preserve">
<value>Learn more about PowerToys Run</value>
<comment>PowerToys Run is a product name, do not loc</comment>
</data>
<data name="LearnMore_MeasureTool.Text" xml:space="preserve">
<value>Learn more about Screen Ruler</value>
<comment>Screen Ruler is a product name, do not loc</comment>
</data>
<data name="LearnMore_ShortcutGuide.Text" xml:space="preserve">
<value>Learn more about Shortcut Guide</value>
@@ -2292,4 +2364,4 @@ From there, simply click on one of the supported files in the File Explorer and
<data name="Run_ConflictingKeywordInfo_Link.Content" xml:space="preserve">
<value>Learn more about conflicting activation commands</value>
</data>
</root>
</root>