2026-04-25 13:56:16 +08:00
|
|
|
<ui:Page x:Class="Ink_Canvas.Windows.SettingsViews.Pages.InkRecognitionPage"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:local="clr-namespace:Ink_Canvas.Windows.SettingsViews.Pages"
|
|
|
|
|
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
|
|
|
|
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
|
|
|
|
xmlns:i18n="clr-namespace:Ink_Canvas.MarkupExtensions"
|
|
|
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
|
|
|
xmlns:controls="clr-namespace:Ink_Canvas.Controls;assembly=InkCanvas.Controls"
|
|
|
|
|
xmlns:c="clr-namespace:Ink_Canvas.Converter"
|
|
|
|
|
mc:Ignorable="d"
|
|
|
|
|
Title="墨迹纠正">
|
|
|
|
|
<ScrollViewer PanningMode="VerticalFirst">
|
|
|
|
|
<Grid Margin="59,0,59,0">
|
|
|
|
|
<FrameworkElement.Resources>
|
|
|
|
|
<sys:Double x:Key="SettingsCardSpacing">4</sys:Double>
|
|
|
|
|
<c:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
|
|
|
|
<Style x:Key="SettingsSectionHeaderTextBlockStyle"
|
|
|
|
|
BasedOn="{StaticResource BodyStrongTextBlockStyle}"
|
|
|
|
|
TargetType="TextBlock">
|
|
|
|
|
<Style.Setters>
|
|
|
|
|
<Setter Property="Margin" Value="1,30,0,6" />
|
|
|
|
|
</Style.Setters>
|
|
|
|
|
</Style>
|
|
|
|
|
</FrameworkElement.Resources>
|
|
|
|
|
<Grid>
|
|
|
|
|
<ikw:SimpleStackPanel MaxWidth="1000" HorizontalAlignment="Stretch"
|
|
|
|
|
Spacing="{StaticResource SettingsCardSpacing}">
|
|
|
|
|
|
|
|
|
|
<TextBlock Style="{StaticResource SettingsSectionHeaderTextBlockStyle}"
|
|
|
|
|
Text="{i18n:I18n Key=InkRecog_Title}" />
|
|
|
|
|
|
|
|
|
|
<controls:LabeledSettingsCard x:Name="CardEnableInkToShape"
|
|
|
|
|
Header="{i18n:I18n Key=InkRecog_EnableInkRecognition}"
|
|
|
|
|
Icon="{x:Static ui:SegoeFluentIcons.Draw}"
|
|
|
|
|
SwitchName="ToggleSwitchEnableInkToShape"
|
|
|
|
|
Toggled="ToggleSwitchEnableInkToShape_Toggled" />
|
|
|
|
|
|
|
|
|
|
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_ShapeEngine}"
|
|
|
|
|
Description="{i18n:I18n Key=InkRecog_ShapeEngineHint}">
|
|
|
|
|
<ComboBox x:Name="ComboBoxShapeRecognitionEngine"
|
|
|
|
|
SelectionChanged="ComboBoxShapeRecognitionEngine_SelectionChanged">
|
|
|
|
|
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineAuto}" />
|
|
|
|
|
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineIACore}" />
|
|
|
|
|
<ComboBoxItem Content="{i18n:I18n Key=InkRecog_ShapeEngineWinRT}" />
|
|
|
|
|
</ComboBox>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
|
|
|
|
|
<controls:LabeledSettingsCard x:Name="CardEnableWinRtHandwritingStrokeBeautify"
|
|
|
|
|
Header="{i18n:I18n Key=InkRecog_HandwritingBeautify}"
|
|
|
|
|
Description="{i18n:I18n Key=InkRecog_HandwritingBeautifyHint}"
|
|
|
|
|
Icon="{x:Static ui:SegoeFluentIcons.PenWorkspace}"
|
|
|
|
|
SwitchName="ToggleSwitchEnableWinRtHandwritingStrokeBeautify"
|
|
|
|
|
Toggled="ToggleSwitchEnableWinRtHandwritingStrokeBeautify_Toggled" />
|
|
|
|
|
|
|
|
|
|
<controls:LabeledSettingsCard x:Name="CardEnableInkToShapeNoFakePressureRectangle"
|
|
|
|
|
Header="{i18n:I18n Key=InkRecog_BlockRectFakePressure}"
|
|
|
|
|
ShowWhen="{Binding IsOn, ElementName=CardEnableInkToShape}"
|
|
|
|
|
d:Visibility="Visible"
|
|
|
|
|
Icon="{x:Static ui:SegoeFluentIcons.RectangularClipping}"
|
|
|
|
|
SwitchName="ToggleSwitchEnableInkToShapeNoFakePressureRectangle"
|
|
|
|
|
Toggled="ToggleSwitchEnableInkToShapeNoFakePressureRectangle_Toggled" />
|
|
|
|
|
|
|
|
|
|
<controls:LabeledSettingsCard x:Name="CardEnableInkToShapeNoFakePressureTriangle"
|
|
|
|
|
Header="{i18n:I18n Key=InkRecog_BlockTriFakePressure}"
|
|
|
|
|
ShowWhen="{Binding IsOn, ElementName=CardEnableInkToShape}"
|
|
|
|
|
d:Visibility="Visible"
|
|
|
|
|
Icon="{x:Static ui:SegoeFluentIcons.IncidentTriangle}"
|
|
|
|
|
SwitchName="ToggleSwitchEnableInkToShapeNoFakePressureTriangle"
|
|
|
|
|
Toggled="ToggleSwitchEnableInkToShapeNoFakePressureTriangle_Toggled" />
|
|
|
|
|
|
|
|
|
|
<ui:SettingsExpander Header="形状修正"
|
|
|
|
|
Visibility="{Binding IsOn, ElementName=CardEnableInkToShape, Converter={StaticResource BooleanToVisibilityConverter}}"
|
|
|
|
|
IsExpanded="{Binding IsOn, ElementName=CardEnableInkToShape, Mode=OneWay}"
|
2026-04-25 17:00:02 +08:00
|
|
|
d:Visibility="Visible" d:IsExpanded="True">
|
2026-04-25 13:56:16 +08:00
|
|
|
<ui:SettingsExpander.HeaderIcon>
|
|
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}" />
|
|
|
|
|
</ui:SettingsExpander.HeaderIcon>
|
|
|
|
|
<ui:SettingsExpander.Items>
|
2026-04-25 20:26:56 +08:00
|
|
|
<ui:SettingsCard ContentAlignment="Left">
|
2026-04-25 13:56:16 +08:00
|
|
|
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeTriangle" IsChecked="True"
|
2026-04-25 20:26:56 +08:00
|
|
|
Content="{i18n:I18n Key=InkRecog_FixTriangle}"
|
2026-04-25 13:56:16 +08:00
|
|
|
Checked="ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged"
|
|
|
|
|
Unchecked="ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged" />
|
|
|
|
|
</ui:SettingsCard>
|
2026-04-25 20:26:56 +08:00
|
|
|
<ui:SettingsCard ContentAlignment="Left">
|
2026-04-25 13:56:16 +08:00
|
|
|
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeRectangle" IsChecked="True"
|
2026-04-25 20:26:56 +08:00
|
|
|
Content="{i18n:I18n Key=InkRecog_FixRectangle}"
|
2026-04-25 13:56:16 +08:00
|
|
|
Checked="ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged"
|
|
|
|
|
Unchecked="ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged" />
|
|
|
|
|
</ui:SettingsCard>
|
2026-04-25 20:26:56 +08:00
|
|
|
<ui:SettingsCard ContentAlignment="Left">
|
2026-04-25 13:56:16 +08:00
|
|
|
<CheckBox x:Name="ToggleCheckboxEnableInkToShapeRounded" IsChecked="True"
|
2026-04-25 20:26:56 +08:00
|
|
|
Content="{i18n:I18n Key=InkRecog_FixEllipse}"
|
2026-04-25 13:56:16 +08:00
|
|
|
Checked="ToggleCheckboxEnableInkToShapeRounded_CheckedChanged"
|
|
|
|
|
Unchecked="ToggleCheckboxEnableInkToShapeRounded_CheckedChanged" />
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
</ui:SettingsExpander.Items>
|
|
|
|
|
</ui:SettingsExpander>
|
|
|
|
|
|
2026-04-25 17:00:02 +08:00
|
|
|
<ui:SettingsExpander x:Name="ExpanderAutoStraightenLine"
|
2026-04-25 13:56:16 +08:00
|
|
|
Header="{i18n:I18n Key=InkRecog_AutoStraightLine}"
|
2026-04-25 17:00:02 +08:00
|
|
|
d:Visibility="Visible" d:IsExpanded="True">
|
2026-04-25 13:56:16 +08:00
|
|
|
<ui:SettingsExpander.HeaderIcon>
|
2026-04-25 17:00:02 +08:00
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.LineDisplay}" />
|
2026-04-25 13:56:16 +08:00
|
|
|
</ui:SettingsExpander.HeaderIcon>
|
2026-04-25 17:00:02 +08:00
|
|
|
<ui:ToggleSwitch x:Name="ToggleSwitchAutoStraightenLine"
|
|
|
|
|
OnContent="{DynamicResource Common_On}"
|
|
|
|
|
OffContent="{DynamicResource Common_Off}"
|
|
|
|
|
Toggled="ToggleSwitchAutoStraightenLine_Toggled" />
|
2026-04-25 13:56:16 +08:00
|
|
|
<ui:SettingsExpander.Items>
|
|
|
|
|
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_LengthThreshold}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
|
|
|
|
<Slider x:Name="AutoStraightenLineThresholdSlider" Width="150" Minimum="30" Maximum="300"
|
|
|
|
|
Value="80" TickFrequency="30" IsSnapToTickEnabled="True"
|
|
|
|
|
ValueChanged="AutoStraightenLineThresholdSlider_ValueChanged" />
|
|
|
|
|
<TextBlock Text="{Binding Value, ElementName=AutoStraightenLineThresholdSlider, StringFormat={}{0:0}}"
|
|
|
|
|
VerticalAlignment="Center" FontSize="14" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_Sensitivity}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
|
|
|
|
<Slider x:Name="LineStraightenSensitivitySlider" Width="150" Minimum="0.05" Maximum="2.0"
|
|
|
|
|
Value="0.20" TickFrequency="0.05" IsSnapToTickEnabled="True"
|
|
|
|
|
ValueChanged="LineStraightenSensitivitySlider_ValueChanged" />
|
|
|
|
|
<TextBlock Text="{Binding Value, ElementName=LineStraightenSensitivitySlider, StringFormat={}{0:F2}}"
|
|
|
|
|
VerticalAlignment="Center" FontSize="14" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_HighPrecisionStraighten}"
|
|
|
|
|
Description="{i18n:I18n Key=InkRecog_HighPrecisionHint}">
|
2026-04-25 20:26:56 +08:00
|
|
|
<ui:ToggleSwitch x:Name="ToggleSwitchHighPrecisionLineStraighten"
|
|
|
|
|
OnContent="{DynamicResource Common_On}"
|
|
|
|
|
OffContent="{DynamicResource Common_Off}"
|
|
|
|
|
Toggled="ToggleSwitchHighPrecisionLineStraighten_Toggled" />
|
2026-04-25 13:56:16 +08:00
|
|
|
</ui:SettingsCard>
|
|
|
|
|
</ui:SettingsExpander.Items>
|
|
|
|
|
</ui:SettingsExpander>
|
|
|
|
|
|
2026-04-25 17:00:02 +08:00
|
|
|
<ui:SettingsExpander x:Name="ExpanderLineEndpointSnapping"
|
2026-04-25 13:56:16 +08:00
|
|
|
Header="{i18n:I18n Key=InkRecog_LineEndpointSnapping}"
|
2026-04-25 17:00:02 +08:00
|
|
|
d:Visibility="Visible" d:IsExpanded="True">
|
2026-04-25 13:56:16 +08:00
|
|
|
<ui:SettingsExpander.HeaderIcon>
|
2026-04-25 17:00:02 +08:00
|
|
|
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Link}" />
|
2026-04-25 13:56:16 +08:00
|
|
|
</ui:SettingsExpander.HeaderIcon>
|
2026-04-25 17:00:02 +08:00
|
|
|
<ui:ToggleSwitch x:Name="ToggleSwitchLineEndpointSnapping"
|
|
|
|
|
OnContent="{DynamicResource Common_On}"
|
|
|
|
|
OffContent="{DynamicResource Common_Off}"
|
|
|
|
|
Toggled="ToggleSwitchLineEndpointSnapping_Toggled" />
|
2026-04-25 13:56:16 +08:00
|
|
|
<ui:SettingsExpander.Items>
|
|
|
|
|
<ui:SettingsCard Header="{i18n:I18n Key=InkRecog_SnappingDistance}"
|
|
|
|
|
Description="{i18n:I18n Key=InkRecog_LineEndpointSnappingHint}">
|
|
|
|
|
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
|
|
|
|
|
<Slider x:Name="LineEndpointSnappingThresholdSlider" Width="150" Minimum="5" Maximum="50"
|
|
|
|
|
Value="15" TickFrequency="5" IsSnapToTickEnabled="True"
|
|
|
|
|
ValueChanged="LineEndpointSnappingThresholdSlider_ValueChanged" />
|
|
|
|
|
<TextBlock Text="{Binding Value, ElementName=LineEndpointSnappingThresholdSlider, StringFormat={}{0:0}}"
|
|
|
|
|
VerticalAlignment="Center" FontSize="14" />
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</ui:SettingsCard>
|
|
|
|
|
</ui:SettingsExpander.Items>
|
|
|
|
|
</ui:SettingsExpander>
|
|
|
|
|
|
|
|
|
|
<Rectangle Height="48" />
|
|
|
|
|
|
|
|
|
|
</ikw:SimpleStackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
</ui:Page>
|