[Screen Ruler] Better error handling and reuse D3D device (#20223)

* [Screen Ruler] simplify lines calculation

* [Screen Ruler] Add inches and centimeters support

* [Chore] prefer x64 toolset to avoid hitting C1076

* [Screen Ruler] Allow making screenshots in non-continuous mode

* [Screen Ruler] Use single d3d device for all ops

* [Screen Ruler] remove gpu mutex and clean up screen capturing

* [Screen Ruler] handle and log DXGI initialization failure

* [Screen Ruler] Add unhandled exception handler

* [Screen Ruler] comment out Units of Measure setting

* [Screen Ruler] introduce a separate device dedicated for capturing
This commit is contained in:
Andrey Nekrasov
2022-09-05 15:39:56 +03:00
committed by GitHub
parent feead9c68b
commit 9d7c9c1746
40 changed files with 958 additions and 429 deletions

View File

@@ -155,6 +155,18 @@
<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_UnitsOfMeasure.Header" xml:space="preserve">
<value>Units of measurement</value>
</data>
<data name="MeasureTool_UnitsOfMeasure_Pixels.Content" xml:space="preserve">
<value>Pixels</value>
</data>
<data name="MeasureTool_UnitsOfMeasure_Inches.Content" xml:space="preserve">
<value>Inches</value>
</data>
<data name="MeasureTool_UnitsOfMeasure_Centimeters.Content" xml:space="preserve">
<value>Centimeters</value>
</data>
<data name="MeasureTool_PixelTolerance.Header" xml:space="preserve">
<value>Pixel tolerance for edge detection</value>
</data>

View File

@@ -49,6 +49,7 @@
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.ShowContinuousCaptureWarning}"
IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.ShowContinuousCaptureWarning}"
IsClosable="False" />
<controls:Setting x:Uid="MeasureTool_PerColorChannelEdgeDetection" Icon="&#xE7FB;">
<controls:Setting.ActionContent>
<ToggleSwitch
@@ -56,6 +57,7 @@
x:Uid="MeasureTool_PerColorChannelEdgeDetection_ToggleSwitch" />
</controls:Setting.ActionContent>
</controls:Setting>
<controls:Setting x:Uid="MeasureTool_PixelTolerance">
<controls:Setting.ActionContent>
<Slider Minimum="0"
@@ -65,6 +67,16 @@
</controls:Setting.ActionContent>
</controls:Setting>
<!--<controls:Setting x:Uid="MeasureTool_UnitsOfMeasure" Icon="&#xECC6;">
<controls:Setting.ActionContent>
<ComboBox SelectedIndex="{x:Bind Path=ViewModel.UnitsOfMeasure, Mode=TwoWay}" MinWidth="{StaticResource SettingActionControlMinWidth}">
<ComboBoxItem x:Uid="MeasureTool_UnitsOfMeasure_Pixels" />
<ComboBoxItem x:Uid="MeasureTool_UnitsOfMeasure_Inches" />
<ComboBoxItem x:Uid="MeasureTool_UnitsOfMeasure_Centimeters" />
</ComboBox>
</controls:Setting.ActionContent>
</controls:Setting>-->
<controls:Setting x:Uid="MeasureTool_DrawFeetOnCross">
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind ViewModel.DrawFeetOnCross, Mode=TwoWay}" x:Uid="MeasureTool_DrawFeetOnCross_ToggleSwitch" />