[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

@@ -49,6 +49,7 @@ body:
- PowerAccent
- PowerRename
- PowerToys Run
- Screen ruler
- Shortcut Guide
- STL Thumbnail
- SVG Preview

View File

@@ -40,6 +40,7 @@ body:
- PowerAccent
- PowerRename
- PowerToys Run
- Screen Ruler
- Shortcut Guide
- SVG Preview
- SVG Thumbnail

View File

@@ -66,7 +66,6 @@ appdata
APPICON
appid
appium
APPLASTZONE
Applets
Applicationcan
applicationframehost
@@ -121,7 +120,6 @@ AUTHN
AUTHZ
Autofill
autogenerate
autogenerated
AUTOHIDE
AUTOMATIONPROPERTIES
Autorun
@@ -154,10 +152,13 @@ Bicubic
bigbar
bigobj
binlog
BITMAPFILEHEADER
bitmapimage
BITMAPINFO
BITMAPINFOHEADER
Bitmaps
bitmask
BITSPIXEL
bla
Blockquotes
blog
@@ -266,6 +267,7 @@ CMINVOKECOMMANDINFOEX
CMock
CMONITORS
cmp
cmpgt
cmyk
cnt
Cocklebiddy
@@ -309,6 +311,7 @@ CONFLICTINGMODIFIERSHORTCUT
CONOUT
Consolas
constexpr
consts
contentdialog
contentfiles
CONTEXTHELP
@@ -368,13 +371,14 @@ customaction
CUSTOMACTIONTEST
cvd
CVirtual
cvtepu
cvtsi
cwchar
cwd
cxfksword
CXSMICON
CXVIRTUALSCREEN
cxxopts
Cxxx
cyberrex
Cyrl
CYSMICON
@@ -383,6 +387,8 @@ cziplib
Dac
dacl
damienleroy
DAffine
DAFFINETRANSFORM
Danmarkshavn
DARKPURPLE
DARKTEAL
@@ -396,11 +402,15 @@ Dbg
Dbghelp
DBLCLKS
DBLEPSILON
DCapture
DCBA
DCOM
dcomp
dcompi
DComposition
DDevice
ddf
DDxgi
Deact
debian
debugbreak
@@ -463,6 +473,7 @@ dllexport
dllhost
dllmain
dlls
Dmap
DNLEN
Dns
doctype
@@ -483,6 +494,7 @@ dreamsofameaningfullife
drivedetectionwarning
dshow
dst
DTo
dutil
DVASPECT
DVASPECTINFO
@@ -528,6 +540,7 @@ ekus
elif
elseif
eltociear
emmintrin
Emoji
emptyrecyclebin
ENABLEDPOPUP
@@ -544,6 +557,7 @@ enum
EOAC
EOL
epicgames
epu
Eqn
ERASEBKGND
EREOF
@@ -618,8 +632,6 @@ finalizer
findfast
Firefox
FIXEDFILEINFO
FLASHZONES
FLASHZONESONQUICKSWITCH
flt
flyout
fmtlib
@@ -641,7 +653,6 @@ Functiondiscoverykeys
Futuna
fwlink
fwrite
fxcop
FZE
gabime
GAC
@@ -666,12 +677,15 @@ GETMINMAXINFO
GETSTATE
GETTEXT
GETTEXTLENGTH
GHND
github
githubusercontent
globals
GMEM
GNumber
google
GPTR
gpu
GSM
gtm
gui
@@ -710,6 +724,7 @@ helptext
Heure
HEVC
hfile
HGFE
hglobal
hhk
HHmmss
@@ -756,6 +771,7 @@ hotlight
hotspot
Hovd
HPAINTBUFFER
HPALETTE
HRAWINPUT
hread
HREDRAW
@@ -770,6 +786,7 @@ hsl
hstring
hsv
htcfreek
HTCLIENT
HTHUMBNAIL
HTTRANSPARENT
HValue
@@ -811,6 +828,7 @@ IDD
IDelayed
IDesktop
IDictionary
IDirect
IDirectory
IDispatch
IDispatcher
@@ -819,6 +837,7 @@ idl
IDLIST
IDOn
IDR
IDrawing
IDrive
idx
IDXGI
@@ -847,6 +866,7 @@ IFormat
IFormatter
ifstream
IGraph
IGraphics
iid
IImage
Iindex
@@ -1100,7 +1120,6 @@ LMEM
LMENU
lnk
LOADLIBRARYASDATAFILE
LOADSTRING
LOBYTE
LOCALAPPDATA
LOCALDISPLAY
@@ -1123,6 +1142,7 @@ lookbehind
lowlevel
LOWORD
lparam
LPBITMAPINFOHEADER
LPBYTE
LPCITEMIDLIST
LPCMINVOKECOMMANDINFO
@@ -1237,6 +1257,7 @@ MINIMIZEEND
MINIMIZESTART
miniz
minlevel
minmax
MINORVERSION
Miracast
Mishkeegogamang
@@ -1265,11 +1286,9 @@ MOUSEACTIVATE
MOUSEHWHEEL
MOUSEINPUT
MOUSEMOVE
MOUSESWITCH
MOUSEWHEEL
MOVESIZEEND
MOVESIZESTART
MOVEWINDOWS
mozilla
mpmc
MRM
@@ -1366,6 +1385,7 @@ NOASYNC
NOCLOSEPROCESS
NOCOPYBITS
nodeca
nodiscard
nodoc
noexcept
NOINHERITLAYOUT
@@ -1638,7 +1658,6 @@ QUERYENDSESSION
QUERYOPEN
QUEUESYNC
Quickime
QUICKLAYOUTSWITCH
QUNS
qwertyuiopasdfghjklzxcvbnm
qword
@@ -1671,7 +1690,7 @@ rects
recyclebin
redirectedfrom
Redist
Redistributable
redistributable
reencode
reencoded
refactor
@@ -1711,7 +1730,6 @@ Resizable
resizers
resmimetype
RESOURCEID
RESTORESIZE
RESTORETOMAXIMIZED
restrictedcapabilities
restrictederrorinfo
@@ -1739,6 +1757,7 @@ roadmap
robmensching
Roboto
rohanrdy
Roolr
roslyn
Rothera
roundf
@@ -1812,6 +1831,7 @@ SETTINGCHANGE
settingsheader
settingshotkeycontrol
SETWORKAREA
setzero
sfgao
SFGAOF
SFP
@@ -1827,7 +1847,6 @@ SHELLEXECUTEINFOW
shellscalingapi
SHFILEINFO
SHGFI
SHIFTDRAG
Shl
shldisp
shlobj
@@ -1916,6 +1935,7 @@ srme
srre
srw
srwlock
sse
ssf
ssh
sstream
@@ -1959,6 +1979,7 @@ stoull
strcmp
streampos
strftime
strikethrough
Stringified
Stringify
STRINGIZE
@@ -1979,6 +2000,7 @@ subkey
SUBLANG
submenu
subquery
subresource
substr
Sul
Superbar
@@ -2031,6 +2053,7 @@ taskkill
tasklist
taskschd
tchar
Tcollab
tcscpy
TCustom
tdbuild
@@ -2043,7 +2066,6 @@ Tenggara
testcase
testhost
testprocess
testzones
TEXCOORD
textblock
TEXTINCLUDE
@@ -2112,6 +2134,7 @@ uefi
UHash
UIA
uid
UIEx
uint
uintptr
UIPI
@@ -2129,6 +2152,7 @@ undef
UNDNAME
unescape
Unicast
UNICODETEXT
Unindent
Uninitialize
uninstall
@@ -2177,16 +2201,20 @@ Uvs
uwp
uxtheme
UYVY
vabdq
validmodulename
Vanara
vcamp
vcdl
vcgtq
VCINSTALLDIR
vcm
Vcpkg
VCRT
vcvars
VDesktop
vdi
vdupq
vec
VERBSONLY
VERBW
@@ -2196,6 +2224,8 @@ VERSIONINFO
Versioning
vformat
VFT
vget
vgetq
vid
VIDCAP
videoconference
@@ -2214,15 +2244,21 @@ visualstudio
viter
VKey
VKTAB
vmovl
vorrq
VOS
vpaddlq
Vpn
vqsubq
VREDRAW
vreinterpretq
VSC
VSCBD
vscdb
vscode
vsconfig
VSCROLL
vsetq
vsonline
vstemplate
VSTHRD
@@ -2241,11 +2277,13 @@ wchar
WClass
wcout
wcscat
wcschr
wcscmp
wcscpy
wcslen
wcsncmp
wcsnicmp
wcsstr
wdp
wdupenv
weakme
@@ -2307,6 +2345,7 @@ winsdkver
winspool
WINTHRESHOLD
winui
winuiex
winxamlmanager
wistd
withinrafael
@@ -2383,6 +2422,7 @@ XLoc
XNamespace
XOffset
xpath
XPixel
XResource
xsi
XStr
@@ -2403,10 +2443,7 @@ ZEROINIT
ZIndex
zipfile
zonable
ZONECOLOR
ZONEHIGHLIGHTCOLOR
zoneset
ZONESETCHANGE
Zoneszonabletester
Zonev
zzz