[feature] UI优化,条件性的墨迹识别,可以关闭部分不需要的形状识别。可以修改是否为墨迹识别的三角形或矩形应用模拟压感值。

This commit is contained in:
Dubi906w 2024-05-11 20:57:09 +08:00
parent dcbd0258bb
commit fda23c5c96
14 changed files with 259 additions and 63 deletions

View File

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33530.505
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ink Canvas", "Ink Canvas\Ink Canvas.csproj", "{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ink Canvas", "Ink Canvas\Ink Canvas.csproj", "{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -27,8 +27,8 @@ Global
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Debug|ARM64.Build.0 = Debug|ARM64
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Debug|x64.ActiveCfg = Debug|x64
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Debug|x64.Build.0 = Debug|x64
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Debug|x86.ActiveCfg = Debug|x86
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Debug|x86.Build.0 = Debug|x86
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Debug|x86.ActiveCfg = Debug|Any CPU
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Debug|x86.Build.0 = Debug|Any CPU
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Release|Any CPU.Build.0 = Release|Any CPU
{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}.Release|ARM.ActiveCfg = Release|Any CPU

View File

@ -24,14 +24,22 @@
<BootstrapperEnabled>false</BootstrapperEnabled>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWPF>true</UseWPF>
<Configurations>Debug;Release;x86 Debug</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<DebugType>none</DebugType>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Prefer32Bit>True</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|AnyCPU'">
<DebugType>none</DebugType>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Prefer32Bit>True</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugType>none</DebugType>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Prefer32Bit>True</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icc.ico</ApplicationIcon>
@ -42,6 +50,12 @@
<LangVersion>7.3</LangVersion>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|x86'">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<DebugType>full</DebugType>
<LangVersion>7.3</LangVersion>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<DebugType>pdbonly</DebugType>
@ -58,6 +72,7 @@
<PackageProjectUrl>https://icc.bliemhax.com</PackageProjectUrl>
<FileVersion>bundled</FileVersion>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
@ -65,6 +80,12 @@
<LangVersion>7.3</LangVersion>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|ARM64'">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<DebugType>full</DebugType>
<LangVersion>7.3</LangVersion>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<DebugType>pdbonly</DebugType>
@ -77,6 +98,12 @@
<LangVersion>7.3</LangVersion>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|x64'">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<DebugType>full</DebugType>
<LangVersion>7.3</LangVersion>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<DebugType>pdbonly</DebugType>
@ -273,6 +300,11 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Icons-Fluent\ic_fluent_people_24_regular.png" />
<Resource Include="Resources\new-icons\end-slides-show.png">
<CopyToOutputDirectory></CopyToOutputDirectory>
</Resource>
<Resource Include="Resources\new-icons\hand-move.png" />
<Resource Include="Resources\new-icons\multi-touch.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\new-icons\pen-lined.png" />
@ -293,6 +325,7 @@
<ItemGroup>
<Resource Include="Resources\new-icons\lasso-select-lined.png" />
<Resource Include="Resources\new-icons\lasso-select-solid.png" />
<Resource Include="Resources\new-icons\rotate.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\new-icons\trash.png" />
@ -404,10 +437,18 @@
</ItemGroup>
<ItemGroup>
<Resource Include="icc.ico" />
<Resource Include="Resources\new-icons\zoom.png" />
</ItemGroup>
<ItemGroup>
<Compile Remove="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\new-icons\end-slides-show.png" />
<None Remove="Resources\new-icons\hand-move.png" />
<None Remove="Resources\new-icons\multi-touch.png" />
<None Remove="Resources\new-icons\rotate.png" />
<None Remove="Resources\new-icons\zoom.png" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>

View File

@ -910,9 +910,42 @@
<GroupBox.Header>
<TextBlock Text="墨迹纠正" FontWeight="Bold" Foreground="#18181b" FontSize="26"/>
</GroupBox.Header>
<ui:SimpleStackPanel Spacing="12">
<ui:SimpleStackPanel Spacing="6">
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="启用墨迹识别" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableInkToShape" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableInkToShape_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="# 可实现智能识别圆、三角形、矩形,并自动转换为规范图形。" Foreground="#666666"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableInkToShape" Header="启用墨迹识别" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableInkToShape_Toggled" IsOn="True"/>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="阻止矫正后的矩形带有模拟压感值" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableInkToShapeNoFakePressureRectangle" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableInkToShapeNoFakePressureRectangle_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="阻止矫正后的三角形带有模拟压感值" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchEnableInkToShapeNoFakePressureTriangle" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchEnableInkToShapeNoFakePressureTriangle_Toggled"/>
</ui:SimpleStackPanel>
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4"/>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<CheckBox IsChecked="True" Name="ToggleCheckboxEnableInkToShapeTriangle" Checked="ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged" Unchecked="ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged">
<CheckBox.Content>
<TextBlock Text="矫正手绘三角形" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
</CheckBox.Content>
</CheckBox>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<CheckBox IsChecked="True" Name="ToggleCheckboxEnableInkToShapeRectangle" Checked="ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged" Unchecked="ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged">
<CheckBox.Content>
<TextBlock Text="矫正手绘矩形" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
</CheckBox.Content>
</CheckBox>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<CheckBox IsChecked="True" Name="ToggleCheckboxEnableInkToShapeRounded" Checked="ToggleCheckboxEnableInkToShapeRounded_CheckedChanged" Unchecked="ToggleCheckboxEnableInkToShapeRounded_CheckedChanged">
<CheckBox.Content>
<TextBlock Text="矫正手绘圆形与椭圆" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
</CheckBox.Content>
</CheckBox>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox Name="GroupBoxAppearanceNewUI">
@ -1002,12 +1035,12 @@
<TextBlock Text="自动幻灯片截屏" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchAutoSaveScreenShotInPowerPoint" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchAutoSaveScreenShotInPowerPoint_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="#开启 自动幻灯片截屏 后将会在幻灯片有墨迹时翻页自动截屏" TextWrapping="Wrap" Foreground="#666666"/>
<TextBlock Text="# 开启 自动幻灯片截屏 后将会在幻灯片有墨迹时翻页自动截屏" TextWrapping="Wrap" Foreground="#666666"/>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="自动保存幻灯片墨迹" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
<ui:ToggleSwitch Name="ToggleSwitchAutoSaveStrokesInPowerPoint" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" OnContent="开" OffContent="关" Toggled="ToggleSwitchAutoSaveStrokesInPowerPoint_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="#开启 自动保存幻灯片墨迹 后将在结束幻灯片放映时自动将保存已有墨迹,并在下次打开时自动加载(文件名和幻灯片页数都要相同)" TextWrapping="Wrap" Foreground="#666666"/>
<TextBlock Text="# 开启 自动保存幻灯片墨迹 后将在结束幻灯片放映时自动将保存已有墨迹,并在下次打开时自动加载(文件名和幻灯片页数都要相同)" TextWrapping="Wrap" Foreground="#666666"/>
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4"/>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="记忆并提示上次播放位置" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0"/>
@ -1574,14 +1607,14 @@
<ScaleTransform x:Name="ViewboxFloatingBarScaleTransform" ScaleX="1" ScaleY="1"/>
</Viewbox.LayoutTransform>
<ui:SimpleStackPanel Orientation="Horizontal">
<Border x:Name="BorderFloatingBarMoveControls" Width="36" Height="36" CornerRadius="5" Background="{DynamicResource FloatBarBackground}" BorderThickness="1" BorderBrush="{DynamicResource FloatBarBorderBrush}"
<Border x:Name="BorderFloatingBarMoveControls" Width="36" Height="36" CornerRadius="5" Background="#fafafa" BorderThickness="1" BorderBrush="#9952525b"
MouseDown="SymbolIconEmoji_MouseDown" MouseUp="SymbolIconEmoji_MouseUp">
<ui:SimpleStackPanel Margin="0,5,0,5" Orientation="Horizontal"
HorizontalAlignment="Center">
<ui:SymbolIcon Name="SymbolIconEmoji" Symbol="Emoji2" Foreground="{DynamicResource FloatBarForeground}"/>
</ui:SimpleStackPanel>
</Border>
<Border Margin="2,0,0,0" Padding="2" Visibility="Visible" Height="36" Name="BorderFloatingBarMainControls" Background="{DynamicResource FloatBarBackground}" CornerRadius="5" BorderThickness="1" BorderBrush="{DynamicResource FloatBarBorderBrush}">
<Border Margin="2,0,0,0" Padding="2" Visibility="Visible" Height="36" Name="BorderFloatingBarMainControls" Background="#fafafa" CornerRadius="5" BorderThickness="1" BorderBrush="#9952525b">
<ui:SimpleStackPanel Margin="2,0" Name="StackPanelFloatingBar" Orientation="Horizontal">
<!--<ui:SimpleStackPanel Name="Cursor_Icon" MouseDown="Border_MouseDown" MouseUp="CursorIcon_Click"-->
<ui:SimpleStackPanel Name="Cursor_Icon" MouseLeave="FloatingBarIcons_MouseUp_MouseLeave" MouseDown="FloatingBarIcons_MouseDown_New" MouseUp="CursorIcon_Click"
@ -1907,15 +1940,15 @@
<Border Margin="2,0,2,0" BorderBrush="#71717a" BorderThickness="1,0,0,0" >
</Border>
<ui:SimpleStackPanel MouseDown="Border_MouseDown" MouseUp="ImageBlackboard_MouseUp" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="28" Margin="0,-2">
<ui:SimpleStackPanel MouseLeave="FloatingBarIcons_MouseUp_MouseLeave" MouseDown="FloatingBarIcons_MouseDown_New" MouseUp="ImageBlackboard_MouseUp" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="28" Margin="0,-2">
<Image Source="/Resources/new-icons/blackboard.png" RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17" Margin="0,3,0,0"/>
<TextBlock x:Name="WhiteboardToolbarTextBlock" Text="白板" Foreground="Black" FontSize="8" Margin="0,1,0,0" TextAlignment="Center"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel MouseDown="Border_MouseDown" MouseUp="SymbolIconTools_MouseUp" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="28" Margin="0,-2">
<ui:SimpleStackPanel MouseLeave="FloatingBarIcons_MouseUp_MouseLeave" MouseDown="FloatingBarIcons_MouseDown_New" MouseUp="SymbolIconTools_MouseUp" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="28" Margin="0,-2">
<Image Source="/Resources/new-icons/grid.png" RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17" Margin="0,3,0,0"/>
<TextBlock x:Name="ToolsToolbarTextBlock" Text="工具" Foreground="Black" FontSize="8" Margin="0,1,0,0" TextAlignment="Center"/>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel x:Name="Fold_Icon" MouseDown="Border_MouseDown" MouseUp="FoldFloatingBar_MouseUp" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="28" Margin="0,-2">
<ui:SimpleStackPanel MouseLeave="FloatingBarIcons_MouseUp_MouseLeave" MouseDown="FloatingBarIcons_MouseDown_New" x:Name="Fold_Icon" MouseUp="FoldFloatingBar_MouseUp" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="28" Margin="0,-2">
<Image Source="/Resources/new-icons/eye-off.png" RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17" Margin="0,3,0,0"/>
<TextBlock x:Name="HideToolbarTextBlock" Text="隐藏" Foreground="Black" FontSize="8" Margin="0,1,0,0" TextAlignment="Center"/>
</ui:SimpleStackPanel>
@ -1981,8 +2014,8 @@
</Border>
<Border Margin="2,0,0,0" x:Name="EnableTwoFingerGestureBorder" Visibility="Visible" Width="36" Height="36" MouseUp="TwoFingerGestureBorder_MouseUp" CornerRadius="5" Background="{DynamicResource FloatBarBackground}" BorderBrush="{DynamicResource FloatBarBorderBrush}" BorderThickness="1" >
<ui:SimpleStackPanel Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="28" Margin="0">
<Border Margin="2,0,0,0" x:Name="EnableTwoFingerGestureBorder" Visibility="Visible" Width="36" Height="36" CornerRadius="5" Background="#fafafa" BorderBrush="#9952525b" BorderThickness="1" >
<ui:SimpleStackPanel MouseLeave="FloatingBarIcons_MouseUp_MouseLeave" MouseDown="FloatingBarIcons_MouseDown_New" MouseUp="TwoFingerGestureBorder_MouseUp" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="36" Margin="0">
<Image x:Name="EnableTwoFingerGestureBtn" Source="/Resources/new-icons/gesture.png" RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="18" Margin="0,3,0,0"/>
<TextBlock x:Name="gestureiconText" Text="手势" Foreground="Black" FontSize="8" Margin="0,0,0,0" TextAlignment="Center"/>
</ui:SimpleStackPanel>
@ -1994,7 +2027,7 @@
<TextBlock Text="手势选项" Foreground="White" Padding="0,5" FontSize="11" FontWeight="Bold" TextAlignment="Center"/>
</Border>
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="4" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,3,0,0">
<Image Source="/Resources/Icons-Fluent/ic_fluent_people_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="14" Width="14"/>
<Image Source="/Resources/new-icons/multi-touch.png" RenderOptions.BitmapScalingMode="HighQuality" Height="16" Width="16"/>
<Label Content="多指书写" FontSize="10" VerticalAlignment="Center"/>
<Viewbox Width="36" Height="18" Margin="4,0,0,0">
<ui:ToggleSwitch MinWidth="0" Margin="0,-6,0,-6" Name="ToggleSwitchEnableMultiTouchMode" FontFamily="Microsoft YaHei UI" IsOn="False" OnContent="" OffContent="" Toggled="ToggleSwitchEnableMultiTouchMode_Toggled" RenderTransformOrigin="0.5,0.5">
@ -2010,7 +2043,7 @@
</Viewbox>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Opacity="1" x:Name="TwoFingerGestureSimpleStackPanel" Orientation="Horizontal" Spacing="4" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_drag_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="14" Width="14"/>
<Image Source="/Resources/new-icons/hand-move.png" RenderOptions.BitmapScalingMode="HighQuality" Height="16" Width="16"/>
<Label Content="双指移动" FontSize="10" VerticalAlignment="Center"/>
<Viewbox Width="36" Height="18" Margin="4,0,0,0">
<ui:ToggleSwitch MinWidth="0" Margin="0,-6,0,-6" Name="ToggleSwitchEnableTwoFingerTranslate" FontFamily="Microsoft YaHei UI" IsOn="False" OnContent="" OffContent="" Toggled="ToggleSwitchEnableTwoFingerTranslate_Toggled" RenderTransformOrigin="0.5,0.5">
@ -2026,7 +2059,7 @@
</Viewbox>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Opacity="{Binding ElementName=TwoFingerGestureSimpleStackPanel, Path=Opacity}" Orientation="Horizontal" Spacing="4" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_scale_fit_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="14" Width="14"/>
<Image Source="/Resources/new-icons/zoom.png" RenderOptions.BitmapScalingMode="HighQuality" Height="16" Width="16"/>
<Label Content="双指缩放" FontSize="10" VerticalAlignment="Center"/>
<Viewbox Width="36" Height="18" Margin="4,0,0,0">
<ui:ToggleSwitch MinWidth="0" Margin="0,-6,0,-6" FontFamily="Microsoft YaHei UI" IsOn="False" OnContent="" OffContent="" Name="ToggleSwitchEnableTwoFingerZoom" Toggled="ToggleSwitchEnableTwoFingerZoom_Toggled" RenderTransformOrigin="0.5,0.5">
@ -2042,7 +2075,7 @@
</Viewbox>
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Opacity="{Binding ElementName=TwoFingerGestureSimpleStackPanel, Path=Opacity}" Orientation="Horizontal" Spacing="4" VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Resources/Icons-Fluent/ic_fluent_arrow_rotate_clockwise_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="14" Width="14"/>
<Image Source="/Resources/new-icons/rotate.png" RenderOptions.BitmapScalingMode="HighQuality" Height="16" Width="16"/>
<Label Content="双指旋转" FontSize="10" VerticalAlignment="Center"/>
<Viewbox Width="36" Height="18" Margin="4,0,0,0">
<ui:ToggleSwitch MinWidth="0" Margin="0,-6,0,-6" FontFamily="Microsoft YaHei UI" IsOn="False" OnContent="" OffContent="" Name="ToggleSwitchEnableTwoFingerRotation" Toggled="ToggleSwitchEnableTwoFingerRotation_Toggled" RenderTransformOrigin="0.5,0.5">
@ -2061,13 +2094,14 @@
</ui:SimpleStackPanel>
</Border>
</Grid>
<!--Visibility="{Binding ElementName=BtnPPTSlideShowEnd, Path=Visibility}">-->
<Border x:Name="BorderFloatingBarExitPPTBtn" Margin="2,0,0,0" Width="34" Height="36" MouseDown="Border_MouseDown" MouseUp="ImagePPTControlEnd_MouseUp"
Background="{DynamicResource FloatBarBackground}" CornerRadius="4" BorderThickness="1" BorderBrush="{DynamicResource FloatBarBorderBrush}"
Visibility="{Binding ElementName=BtnPPTSlideShowEnd, Path=Visibility}">
<Grid>
<Image Source="{DynamicResource ResourceKey=SeewoImageSource.PPTExitNormal}" Visibility="{Binding ElementName=BtnPPTSlideShowEnd, Path=Visibility}" Height="20" Width="30" />
</Grid>
<ui:SimpleStackPanel Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Width="28" Margin="0,0">
<Image Source="/Resources/new-icons/end-slides-show.png" RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17" Margin="0,3,0,0"/>
<TextBlock Text="退出" Foreground="Black" FontSize="8" Margin="0,1,0,0" TextAlignment="Center"/>
</ui:SimpleStackPanel>
</Border>
</ui:SimpleStackPanel>
</Viewbox>

View File

@ -10,6 +10,7 @@ namespace Ink_Canvas {
bool isFloatingBarFolded = false, isFloatingBarChangingHideMode = false;
private async void FoldFloatingBar_MouseUp(object sender, MouseButtonEventArgs e) {
FloatingBarIcons_MouseUp_New(sender);
if (sender == null) {
foldFloatingBarByUser = false;
} else {

View File

@ -27,6 +27,7 @@ namespace Ink_Canvas {
#region TwoFingZoomBtn
private void TwoFingerGestureBorder_MouseUp(object sender, RoutedEventArgs e) {
FloatingBarIcons_MouseUp_New(sender);
if (TwoFingerGestureBorder.Visibility == Visibility.Visible) {
AnimationsHelper.HideWithSlideAndFade(TwoFingerGestureBorder);
AnimationsHelper.HideWithSlideAndFade(BoardTwoFingerGestureBorder);
@ -374,6 +375,7 @@ namespace Ink_Canvas {
bool Not_Enter_Blackboard_fir_Mouse_Click = true;
bool isDisplayingOrHidingBlackboard = false;
private void ImageBlackboard_MouseUp(object sender, MouseButtonEventArgs e) {
FloatingBarIcons_MouseUp_New(sender);
if (isDisplayingOrHidingBlackboard) return;
isDisplayingOrHidingBlackboard = true;
@ -593,6 +595,7 @@ namespace Ink_Canvas {
}
private void SymbolIconTools_MouseUp(object sender, MouseButtonEventArgs e) {
FloatingBarIcons_MouseUp_New(sender);
if (BorderTools.Visibility == Visibility.Visible) {
AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);

View File

@ -656,6 +656,12 @@ namespace Ink_Canvas {
Settings.Gesture.IsEnableTwoFingerRotationOnSelection = false;
Settings.InkToShape.IsInkToShapeEnabled = true;
Settings.InkToShape.IsInkToShapeNoFakePressureRectangle = false;
Settings.InkToShape.IsInkToShapeNoFakePressureTriangle = false;
Settings.InkToShape.IsInkToShapeTriangle = true;
Settings.InkToShape.IsInkToShapeRectangle = true;
Settings.InkToShape.IsInkToShapeRounded = true;
Settings.Startup.IsEnableNibMode = false;
Settings.Startup.IsAutoUpdate = true;
@ -702,6 +708,41 @@ namespace Ink_Canvas {
SaveSettingsToFile();
}
private void ToggleSwitchEnableInkToShapeNoFakePressureTriangle_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.InkToShape.IsInkToShapeNoFakePressureTriangle = ToggleSwitchEnableInkToShapeNoFakePressureTriangle.IsOn;
SaveSettingsToFile();
}
private void ToggleSwitchEnableInkToShapeNoFakePressureRectangle_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.InkToShape.IsInkToShapeNoFakePressureRectangle = ToggleSwitchEnableInkToShapeNoFakePressureRectangle.IsOn;
SaveSettingsToFile();
}
private void ToggleCheckboxEnableInkToShapeTriangle_CheckedChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.InkToShape.IsInkToShapeTriangle = (bool)ToggleCheckboxEnableInkToShapeTriangle.IsChecked;
SaveSettingsToFile();
}
private void ToggleCheckboxEnableInkToShapeRectangle_CheckedChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.InkToShape.IsInkToShapeRectangle = (bool)ToggleCheckboxEnableInkToShapeRectangle.IsChecked;
SaveSettingsToFile();
}
private void ToggleCheckboxEnableInkToShapeRounded_CheckedChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.InkToShape.IsInkToShapeRounded = (bool)ToggleCheckboxEnableInkToShapeRounded.IsChecked;
SaveSettingsToFile();
}
#endregion
#region Advanced

View File

@ -370,6 +370,45 @@ namespace Ink_Canvas {
} else {
ToggleSwitchEnableInkToShape.IsOn = false;
}
if (Settings.InkToShape.IsInkToShapeNoFakePressureRectangle)
{
ToggleSwitchEnableInkToShapeNoFakePressureRectangle.IsOn = true;
}
else
{
ToggleSwitchEnableInkToShapeNoFakePressureRectangle.IsOn = false;
}
if (Settings.InkToShape.IsInkToShapeNoFakePressureTriangle)
{
ToggleSwitchEnableInkToShapeNoFakePressureTriangle.IsOn = true;
}
else
{
ToggleSwitchEnableInkToShapeNoFakePressureTriangle.IsOn = false;
}
if (Settings.InkToShape.IsInkToShapeTriangle)
{
ToggleCheckboxEnableInkToShapeTriangle.IsChecked = true;
} else
{
ToggleCheckboxEnableInkToShapeTriangle.IsChecked= false;
}
if (Settings.InkToShape.IsInkToShapeRectangle)
{
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = true;
}
else
{
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = false;
}
if (Settings.InkToShape.IsInkToShapeRounded)
{
ToggleCheckboxEnableInkToShapeRounded.IsChecked = true;
}
else
{
ToggleCheckboxEnableInkToShapeRounded.IsChecked = false;
}
} else {
Settings.InkToShape = new InkToShape();
}

View File

@ -45,7 +45,7 @@ namespace Ink_Canvas {
//Label.Visibility = Visibility.Visible;
//Label.Content = circles.Count.ToString() + "\n" + newResult.InkDrawingNode.GetShapeName();
}
if (result.InkDrawingNode.GetShapeName() == "Circle") {
if (result.InkDrawingNode.GetShapeName() == "Circle" && Settings.InkToShape.IsInkToShapeRounded == true) {
var shape = result.InkDrawingNode.GetShape();
if (shape.Width > 75) {
foreach (Circle circle in circles) {
@ -94,7 +94,7 @@ namespace Ink_Canvas {
_currentCommitType = CommitReason.UserInput;
newStrokes = new StrokeCollection();
}
} else if (result.InkDrawingNode.GetShapeName().Contains("Ellipse")) {
} else if (result.InkDrawingNode.GetShapeName().Contains("Ellipse") && Settings.InkToShape.IsInkToShapeRounded == true) {
var shape = result.InkDrawingNode.GetShape();
//var shape1 = result.InkDrawingNode.GetShape();
//shape1.Fill = Brushes.Gray;
@ -215,11 +215,12 @@ namespace Ink_Canvas {
GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
newStrokes = new StrokeCollection();
}
} else if (result.InkDrawingNode.GetShapeName().Contains("Triangle")) {
} else if (result.InkDrawingNode.GetShapeName().Contains("Triangle") && Settings.InkToShape.IsInkToShapeTriangle==true) {
var shape = result.InkDrawingNode.GetShape();
var p = result.InkDrawingNode.HotPoints;
if ((Math.Max(Math.Max(p[0].X, p[1].X), p[2].X) - Math.Min(Math.Min(p[0].X, p[1].X), p[2].X) >= 100 ||
Math.Max(Math.Max(p[0].Y, p[1].Y), p[2].Y) - Math.Min(Math.Min(p[0].Y, p[1].Y), p[2].Y) >= 100) && result.InkDrawingNode.HotPoints.Count == 3) {
Math.Max(Math.Max(p[0].Y, p[1].Y), p[2].Y) - Math.Min(Math.Min(p[0].Y, p[1].Y), p[2].Y) >= 100) && result.InkDrawingNode.HotPoints.Count == 3)
{
//纠正垂直与水平关系
var newPoints = FixPointsDirection(p[0], p[1]);
p[0] = newPoints[0];
@ -234,7 +235,8 @@ namespace Ink_Canvas {
var pointList = p.ToList();
//pointList.Add(p[0]);
var point = new StylusPointCollection(pointList);
var stroke = new Stroke(GenerateFakePressureTriangle(point)) {
var stroke = new Stroke(GenerateFakePressureTriangle(point))
{
DrawingAttributes = inkCanvas.DefaultDrawingAttributes.Clone()
};
SetNewBackupOfStroke();
@ -245,10 +247,10 @@ namespace Ink_Canvas {
GridInkCanvasSelectionCover.Visibility = Visibility.Collapsed;
newStrokes = new StrokeCollection();
}
} else if (result.InkDrawingNode.GetShapeName().Contains("Rectangle") ||
} else if ((result.InkDrawingNode.GetShapeName().Contains("Rectangle") ||
result.InkDrawingNode.GetShapeName().Contains("Diamond") ||
result.InkDrawingNode.GetShapeName().Contains("Parallelogram") ||
result.InkDrawingNode.GetShapeName().Contains("Square")) {
result.InkDrawingNode.GetShapeName().Contains("Square")) && Settings.InkToShape.IsInkToShapeRectangle == true) {
var shape = result.InkDrawingNode.GetShape();
var p = result.InkDrawingNode.HotPoints;
if ((Math.Max(Math.Max(Math.Max(p[0].X, p[1].X), p[2].X), p[3].X) - Math.Min(Math.Min(Math.Min(p[0].X, p[1].X), p[2].X), p[3].X) >= 100 ||
@ -470,6 +472,24 @@ namespace Ink_Canvas {
}
public StylusPointCollection GenerateFakePressureTriangle(StylusPointCollection points) {
if (Settings.InkToShape.IsInkToShapeNoFakePressureTriangle == true)
{
var newPoint = new StylusPointCollection();
newPoint.Add(new StylusPoint(points[0].X, points[0].Y));
var cPoint = GetCenterPoint(points[0], points[1]);
newPoint.Add(new StylusPoint(cPoint.X, cPoint.Y));
newPoint.Add(new StylusPoint(points[1].X, points[1].Y));
newPoint.Add(new StylusPoint(points[1].X, points[1].Y));
cPoint = GetCenterPoint(points[1], points[2]);
newPoint.Add(new StylusPoint(cPoint.X, cPoint.Y));
newPoint.Add(new StylusPoint(points[2].X, points[2].Y));
newPoint.Add(new StylusPoint(points[2].X, points[2].Y));
cPoint = GetCenterPoint(points[2], points[0]);
newPoint.Add(new StylusPoint(cPoint.X, cPoint.Y));
newPoint.Add(new StylusPoint(points[0].X, points[0].Y));
return newPoint;
} else
{
var newPoint = new StylusPointCollection();
newPoint.Add(new StylusPoint(points[0].X, points[0].Y, (float)0.4));
var cPoint = GetCenterPoint(points[0], points[1]);
@ -485,8 +505,13 @@ namespace Ink_Canvas {
newPoint.Add(new StylusPoint(points[0].X, points[0].Y, (float)0.4));
return newPoint;
}
}
public StylusPointCollection GenerateFakePressureRectangle(StylusPointCollection points) {
if (Settings.InkToShape.IsInkToShapeNoFakePressureRectangle == true) {
return points;
} else
{
var newPoint = new StylusPointCollection();
newPoint.Add(new StylusPoint(points[0].X, points[0].Y, (float)0.4));
var cPoint = GetCenterPoint(points[0], points[1]);
@ -507,6 +532,8 @@ namespace Ink_Canvas {
return newPoint;
}
}
public Point GetCenterPoint(Point point1, Point point2) {
return new Point((point1.X + point2.X) / 2, (point1.Y + point2.Y) / 2);
}

View File

@ -278,6 +278,16 @@ namespace Ink_Canvas
{
[JsonProperty("isInkToShapeEnabled")]
public bool IsInkToShapeEnabled { get; set; } = true;
[JsonProperty("isInkToShapeNoFakePressureRectangle")]
public bool IsInkToShapeNoFakePressureRectangle { get; set; } = false;
[JsonProperty("isInkToShapeNoFakePressureTriangle")]
public bool IsInkToShapeNoFakePressureTriangle { get; set; } = false;
[JsonProperty("isInkToShapeTriangle")]
public bool IsInkToShapeTriangle { get; set; } = true;
[JsonProperty("isInkToShapeRectangle")]
public bool IsInkToShapeRectangle { get; set; } = true;
[JsonProperty("isInkToShapeRounded")]
public bool IsInkToShapeRounded { get; set; } = true;
}
public class RandSettings {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB