[update]修了幾几个小Bug,新增了对鸿合屏幕书写和鸿合轻量白板的自动化支持,让形状识别支持梯形,换了一下图标意思意思,还有其他修复忘了。总之前面忘了,中间忘了,后面忘了。

This commit is contained in:
Dubi906w 2024-06-04 21:21:08 +08:00
parent 8e2fe30309
commit 3e0f8ab61d
29 changed files with 852 additions and 354 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("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ink Canvas", "Ink Canvas\Ink Canvas.csproj", "{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InkCanvasForClass", "Ink Canvas\InkCanvasForClass.csproj", "{8D0EDFC7-F974-4571-BC49-6F3A6653FE81}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -116,7 +116,7 @@ namespace Ink_Canvas.Helpers
catch { }
}
public static void ShowWithScaleFromLeft(UIElement element, double duration = 0.5)
public static void ShowWithScaleFromLeft(UIElement element, double duration = 0.2)
{
try
{
@ -143,6 +143,8 @@ namespace Ink_Canvas.Helpers
To = 1,
Duration = TimeSpan.FromSeconds(duration)
};
scaleYAnimation.EasingFunction = new CubicEase();
scaleXAnimation.EasingFunction = new CubicEase();
Storyboard.SetTargetProperty(scaleYAnimation, new PropertyPath("(UIElement.RenderTransform).(ScaleTransform.ScaleY)"));
sb.Children.Add(scaleXAnimation);
@ -157,7 +159,7 @@ namespace Ink_Canvas.Helpers
catch { }
}
public static void ShowWithScaleFromRight(UIElement element, double duration = 0.5)
public static void ShowWithScaleFromRight(UIElement element, double duration = 0.2)
{
try
{
@ -186,6 +188,9 @@ namespace Ink_Canvas.Helpers
};
Storyboard.SetTargetProperty(scaleYAnimation, new PropertyPath("(UIElement.RenderTransform).(ScaleTransform.ScaleY)"));
scaleYAnimation.EasingFunction = new CubicEase();
scaleXAnimation.EasingFunction = new CubicEase();
sb.Children.Add(scaleXAnimation);
sb.Children.Add(scaleYAnimation);

View File

@ -182,6 +182,7 @@
<Resource Include="Resources\Icons-png\check-box-background.png" />
<Resource Include="Resources\Icons-png\eraser-line.png" />
<Resource Include="Resources\Icons-png\eraser-outline.png" />
<Resource Include="Resources\Icons-png\HiteLightBoard.png" />
<Resource Include="Resources\Icons-png\icc.png" />
<Resource Include="Resources\Icons-png\playCircle.png" />
<Resource Include="Resources\Icons-png\redo.png" />
@ -302,6 +303,7 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Icons-Fluent\ic_fluent_people_24_regular.png" />
<Resource Include="Resources\Icons-png\WenXiang.png" />
<Resource Include="Resources\new-icons\chevron-left.png" />
<Resource Include="Resources\new-icons\end-slides-show.png">
<CopyToOutputDirectory></CopyToOutputDirectory>
@ -414,9 +416,6 @@
<Resource Include="Resources\Icons-png\HiteBoard.png" />
<Resource Include="Resources\Icons-png\HiteCamera.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Icons-png\WenXiang.jpg" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Icons-png\Whiteboard.png" />
</ItemGroup>
@ -451,8 +450,11 @@
<Compile Remove="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Icons-png\HiteAnnotation.png" />
<None Remove="Resources\Icons-png\HiteLightBoard.png" />
<None Remove="Resources\Icons-png\icc.png" />
<None Remove="Resources\Icons-png\transparent-grid.png" />
<None Remove="Resources\Icons-png\WenXiang.png" />
<None Remove="Resources\new-icons\chevron-left.png" />
<None Remove="Resources\new-icons\end-slides-show.png" />
<None Remove="Resources\new-icons\eye.png" />
@ -465,6 +467,9 @@
<None Remove="Resources\new-icons\unfold-chevron.png" />
<None Remove="Resources\new-icons\zoom.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Icons-png\HiteAnnotation.png" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_LastSelectedProfileId>D:\vs\ica\Ink Canvas\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
</PropertyGroup>
</Project>

View File

@ -97,11 +97,11 @@
Executed="KeyDrawLine" />
</Window.CommandBindings>
<Grid x:Name="Main_Grid" Background="#01FFFFFF">
<Grid x:Name="Main_Grid">
<!--// 设置界面 //-->
<Grid Panel.ZIndex="999" x:Name="BorderSettingsMask" MouseDown="SettingsOverlayClick" IsHitTestVisible="False"
Margin="0,0,0,0">
Margin="0,0,0,0">
<Border Name="BorderSettings" Background="#ee18181b" ui:ThemeManager.RequestedTheme="Dark" Width="440"
HorizontalAlignment="Left" Margin="0,150,0,350" Visibility="Visible">
<Grid>
@ -358,8 +358,6 @@
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchClearCanvasAndClearTimeMachine_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="# 开启后点击清屏按钮将会一同清理TimeMachine中的墨迹历史记录这也会导致清屏后无法撤销恢复到原来的笔迹请慎重使用"
TextWrapping="Wrap" Foreground="#a1a1aa" />
<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">
@ -382,8 +380,6 @@
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchFitToCurve_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="# 开启 让墨迹使用贝塞尔曲线平滑 选项后所有墨迹将会使用FitToCurve进行贝塞尔曲线平滑化如果不喜欢可以关闭。"
TextWrapping="Wrap" Foreground="#a1a1aa" />
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox>
@ -429,7 +425,6 @@
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchEnableInkToShape_Toggled" />
</ui:SimpleStackPanel>
<TextBlock Text="# 可实现智能识别圆、三角形、矩形,并自动转换为规范图形。" Foreground="#a1a1aa" />
<ui:SimpleStackPanel Spacing="6"
Visibility="{Binding ElementName=ToggleSwitchEnableInkToShape, Path=IsOn, Converter={StaticResource BooleanToVisibilityConverter}}">
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
@ -593,7 +588,7 @@
Toggled="ToggleSwitchSupportWPS_Toggled" />
</ui:SimpleStackPanel>
<TextBlock
Text="# 不推荐使用 WPS Office鉴于其对于触摸设备的较差支持及其自身的兼容性问题对 WPS Office 支持时会导致 WPS Office 关闭时卡顿。"
Text="# 可支持 WPS但目前无法同时支持 MSOffice 和 WPS。若要启用WPS支持请确保 WPS 是否在 “配置工具” 中开启了 “WPS Office 兼容第三方系统和软件” 选项否则将无法识别到WPS"
TextWrapping="Wrap" Foreground="#a1a1aa" />
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
StrokeThickness="1" Margin="0,4,0,4" />
@ -850,6 +845,16 @@
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchAutoFoldInEasiNote3C_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/HiteLightBoard.png" Margin="0,0,6,0" Width="28"
Height="28" VerticalAlignment="Center" />
<TextBlock Foreground="#fafafa" Text="进入“鸿合轻量白板”时自动收纳"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchAutoFoldInHiteLightBoard" IsOn="True"
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchAutoFoldInHiteLightBoard_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/EasiNote5C.png" Margin="0,0,6,0" Width="28"
Height="28" VerticalAlignment="Center" />
@ -891,7 +896,7 @@
Toggled="ToggleSwitchAutoFoldInHiteCamera_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="/Resources/Icons-png/WenXiang.jpg" Margin="0,0,6,0" Width="28"
<Image Source="/Resources/Icons-png/WenXiang.png" Margin="0,0,6,0" Width="28"
Height="28" VerticalAlignment="Center" />
<TextBlock Foreground="#fafafa" Text="进入“文香白板”时自动收纳" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
@ -954,15 +959,14 @@
Toggled="ToggleSwitchAutoKillEasiNote_Toggled" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="自动阻止ZPH对Powerpoint的接管"
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchAutoKillZygoPresentationHelper" IsOn="True"
FontFamily="Microsoft YaHei UI" FontWeight="Bold" />
<Image Source="/Resources/Icons-png/HiteAnnotation.png" Margin="0,0,6,0" Width="28"
Height="28" VerticalAlignment="Center" />
<TextBlock Foreground="#fafafa" Text="自动查杀 鸿合屏幕书写" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchAutoKillHiteAnnotation"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchAutoKillHiteAnnotation_Toggled" />
</ui:SimpleStackPanel>
<TextBlock
Text="# 此操作會嘗試調用ZygoPresentationHelper的API接口使其將PPT窗口不再設置為自己的子窗口並取消本次放映的接管。也可以在ZPH中設置查殺InkCanvas系列軟件IC、ICA、ICC的選項。"
TextWrapping="Wrap" Foreground="#a1a1aa" />
<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">
@ -1221,7 +1225,7 @@
<Grid Name="GridBackgroundCoverHolder">
<Grid Name="GridBackgroundCover" Visibility="Collapsed" Background="#1F1F1F" />
</Grid>
<Canvas Name="Canvas" />
<Grid Name="GridTransparencyFakeBackground" Opacity="0"/>
<Label Name="Label" Visibility="Collapsed" Foreground="Gray" Content="0" />
<InkCanvas x:Name="inkCanvas" Cursor="Pen" ForceCursor="False"
TouchUp="Main_Grid_TouchUp" TouchDown="Main_Grid_TouchDown"
@ -1260,9 +1264,6 @@
</ui:SimpleStackPanel>
<TextBlock Canvas.Right="25" Canvas.Top="15" Text="多一份理解,少一份抱怨" Name="BlackBoardWaterMark"
Visibility="Collapsed" FontSize="30" FontWeight="Bold" Foreground="White" Opacity="0.5" />
<TextBlock Canvas.Right="25" Canvas.Top="15" Text="test transform" Name="TTT" FontSize="30"
FontWeight="Bold" Foreground="Red" Opacity="0.5" />
</Canvas>
<Grid Visibility="{Binding ElementName=inkCanvas, Path=Visibility}">
<Grid Name="GridInkCanvasSelectionCover"
@ -1576,20 +1577,39 @@
<Border x:Name="BoardSelect" Width="60" Height="55" MouseDown="Border_MouseDown"
MouseUp="SymbolIconSelect_MouseUp" CornerRadius="5,0,0,5" Background="LightGray"
Opacity="0.85">
<Grid Margin="6">
<Grid Margin="6,6,6,4">
<Image VerticalAlignment="Top"
Source="/Resources/Icons-Fluent/ic_fluent_lasso_24_regular.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="28" Width="28" />
RenderOptions.BitmapScalingMode="HighQuality" Height="24" Width="24" >
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M22.7989,10.1653L1.14304,1.14304 10.1653,22.7989 12.8305,14.9518 19.6892,21.8105 21.8105,19.6892 14.9518,12.8305 22.7989,10.1653z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Text="选择" Foreground="Black" VerticalAlignment="Bottom"
HorizontalAlignment="Center" FontSize="12" />
</Grid>
</Border>
<Border x:Name="BoardPen" Width="60" Height="55" MouseDown="Border_MouseDown"
MouseUp="PenIcon_Click" Background="LightGray" Opacity="0.85">
<Grid Margin="6">
<Grid Margin="6,6,6,4">
<Image x:Name="BoardPenIcon" VerticalAlignment="Top"
Source="/Resources/Icons-Fluent/ic_fluent_signature_24_regular.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="28" Width="28" />
RenderOptions.BitmapScalingMode="HighQuality" Height="24" Width="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M20.4786,1.42438C19.9985,1.23743 19.4847,1.15194 18.9698,1.17319 18.4549,1.19444 17.9499,1.32197 17.4869,1.54789 17.0368,1.76752 16.6358,2.07554 16.3083,2.45361L3.85516,14.9067 9.08243,20.134 21.5311,7.68529C21.9113,7.36382 22.223,6.96912 22.447,6.52438 22.6786,6.06462 22.8113,5.56167 22.8365,5.04763 22.8616,4.5336 22.7787,4.02012 22.593,3.54002 22.4073,3.05994 22.1232,2.62403 21.759,2.25988 21.3949,1.89574 20.9587,1.61132 20.4786,1.42438z" />
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M7.28056,21.1605L2.8286,16.7086 1.15912,22.83 7.28056,21.1605z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Text="墨迹" Foreground="Black" VerticalAlignment="Bottom"
HorizontalAlignment="Center" FontSize="12" />
</Grid>
@ -1775,10 +1795,21 @@
</Border>
<Border x:Name="BoardEraser" Width="60" Height="55" MouseDown="Border_MouseDown"
MouseUp="BoardEraserIcon_Click" Background="LightGray" Opacity="0.85">
<Grid Margin="6">
<Image VerticalAlignment="Top" Source="/Resources/Icons-png/eraser-outline.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="28" Width="28" />
<TextBlock Text="面积擦" Foreground="Black" VerticalAlignment="Bottom"
<Grid Margin="6,6,6,4">
<Image VerticalAlignment="Top"
RenderOptions.BitmapScalingMode="HighQuality" Height="24" Width="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M15.6314,20.7262L22.7921,13.5655C24.3494,12.141,24.2819,9.81776,22.8105,8.34633L16.7793,2.31508C15.3547,0.757753,13.0315,0.825236,11.5601,2.29666L4.38099,9.47574 15.6314,20.7262z" />
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M14.2172,22.1404L2.96677,10.89 1.20761,12.6491C-0.34971,14.0737,-0.281711,16.3974,1.18971,17.8688L6.15089,22.83 13.5276,22.83 14.2172,22.1404z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Text="橡皮" Foreground="Black" VerticalAlignment="Bottom"
HorizontalAlignment="Center" FontSize="12" />
</Grid>
</Border>
@ -1796,9 +1827,9 @@
</Grid>
</Border>
</Border>
<Border x:Name="BoardEraserByStrokes" Width="60" Height="55" MouseDown="Border_MouseDown"
<Border x:Name="BoardEraserByStrokes" Width="60" Height="55" MouseDown="Border_MouseDown" Visibility="Collapsed"
MouseUp="BoardEraserIconByStrokes_Click" Background="LightGray" Opacity="0.85">
<Grid Margin="6">
<Grid Margin="6,6,6,4">
<Image VerticalAlignment="Top" Source="/Resources/Icons-png/eraser-line.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="28" Width="28" />
<TextBlock Text="墨迹擦" Foreground="Black" VerticalAlignment="Bottom"
@ -1807,10 +1838,21 @@
</Border>
<Border x:Name="BoardGeometry" Width="60" Height="55" MouseDown="Border_MouseDown"
MouseUp="ImageDrawShape_MouseUp" Background="LightGray" Opacity="0.85">
<Grid Margin="6">
<Grid Margin="6,6,6,4">
<Image VerticalAlignment="Top"
Source="/Resources/Icons-Fluent/ic_fluent_shapes_24_regular.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="28" Width="28" />
RenderOptions.BitmapScalingMode="HighQuality" Height="24" Width="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M17.8604,10.7597L12.0068,1.17001 6.13961,10.7597 17.8604,10.7597z" />
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M10.9345,13.2403L1.34476,13.2403 1.34476,22.83 10.9345,22.83 10.9345,13.2403z" />
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M17.8604,13.2403C15.2122,13.2403 13.0655,15.387 13.0655,18.0352 13.0655,20.6833 15.2122,22.83 17.8604,22.83 20.5085,22.83 22.6552,20.6833 22.6552,18.0352 22.6552,15.387 20.5085,13.2403 17.8604,13.2403z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Text="图形" Foreground="Black" VerticalAlignment="Bottom"
HorizontalAlignment="Center" FontSize="12" />
</Grid>
@ -1943,10 +1985,20 @@
MouseUp="SymbolIconUndo_MouseUp"
IsEnabled="{Binding ElementName=BtnUndo, Path=IsEnabled}" Background="LightGray"
Opacity="0.85">
<Grid Margin="6">
<Image VerticalAlignment="Top" Source="/Resources/Icons-png/undo.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="25" Width="28"
Opacity="{Binding ElementName=BtnUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}" />
<Grid Margin="6,6,6,4">
<Image VerticalAlignment="Top"
RenderOptions.BitmapScalingMode="HighQuality" Height="24" Width="24"
Opacity="{Binding ElementName=BtnUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M8.71408,16.8493L0.874451,9.00964 8.71408,1.17001 8.71408,7.42358 15.7239,7.42358C16.7074,7.42358 17.6791,7.62744 18.583,8.02124 19.4866,8.41493 20.3023,8.98966 20.9857,9.70849 21.6689,10.4271 22.2069,11.276 22.5726,12.2047 22.9383,13.1333 23.1256,14.126 23.1256,15.1268 23.1256,16.1276 22.9383,17.1203 22.5726,18.0489 22.2069,18.9776 21.6689,19.8264 20.9857,20.5451 20.3023,21.2639 19.4866,21.8387 18.583,22.2324 17.6791,22.6262 16.7074,22.83 15.7239,22.83L10.437,22.83 10.437,19.6579 15.7239,19.6579C16.2679,19.6579 16.8086,19.5453 17.3159,19.3243 17.8235,19.1031 18.29,18.7767 18.6867,18.3594 19.0835,17.942 19.4023,17.4422 19.6211,16.8866 19.8399,16.3308 19.9534,15.7326 19.9534,15.1268 19.9534,14.5209 19.8399,13.9227 19.6211,13.367 19.4023,12.8114 19.0835,12.3115 18.6867,11.8941 18.29,11.4769 17.8235,11.1505 17.3159,10.9293 16.8086,10.7083 16.2679,10.5957 15.7239,10.5957L8.71408,10.5957 8.71408,16.8493z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Text="撤销" Foreground="Black" VerticalAlignment="Bottom"
HorizontalAlignment="Center" FontSize="12" />
</Grid>
@ -1955,10 +2007,20 @@
MouseDown="Border_MouseDown" MouseUp="SymbolIconRedo_MouseUp"
IsEnabled="{Binding ElementName=BtnRedo, Path=IsEnabled}" Background="LightGray"
Opacity="0.85">
<Grid Margin="6">
<Image VerticalAlignment="Top" Source="/Resources/Icons-png/redo.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="25" Width="28"
Opacity="{Binding ElementName=BtnRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}" />
<Grid Margin="6,6,6,4">
<Image VerticalAlignment="Top"
RenderOptions.BitmapScalingMode="HighQuality" Height="24" Width="24"
Opacity="{Binding ElementName=BtnRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#18181b" Geometry="F1 M24,24z M0,0z M15.2859,16.8493L23.1255,9.00964 15.2859,1.17001 15.2859,7.42358 8.27607,7.42358C7.29262,7.42358 6.32086,7.62744 5.41703,8.02124 4.51341,8.41493 3.69773,8.98966 3.01434,9.70849 2.33111,10.4271 1.79312,11.276 1.42741,12.2047 1.06174,13.1333 0.874422,14.126 0.874422,15.1268 0.874422,16.1276 1.06174,17.1203 1.42741,18.0489 1.79312,18.9776 2.33111,19.8264 3.01434,20.5451 3.69773,21.2639 4.51341,21.8387 5.41703,22.2324 6.32086,22.6262 7.29262,22.83 8.27607,22.83L13.563,22.83 13.563,19.6579 8.27607,19.6579C7.7321,19.6579 7.19139,19.5453 6.68406,19.3243 6.17652,19.1031 5.70999,18.7767 5.31333,18.3594 4.91651,17.942 4.59775,17.4422 4.37894,16.8866 4.1601,16.3308 4.04656,15.7326 4.04656,15.1268 4.04656,14.5209 4.1601,13.9227 4.37894,13.367 4.59775,12.8114 4.91651,12.3115 5.31333,11.8941 5.70999,11.4769 6.17652,11.1505 6.68406,10.9293 7.19139,10.7083 7.7321,10.5957 8.27607,10.5957L15.2859,10.5957 15.2859,16.8493z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock Text="重做" Foreground="Black" VerticalAlignment="Bottom"
HorizontalAlignment="Center" FontSize="12" />
</Grid>
@ -2525,9 +2587,18 @@
MouseUp="CursorIcon_Click"
Background="Transparent" Orientation="Vertical"
HorizontalAlignment="Center" Width="28" Margin="0,-2">
<Image Source="/Resources/new-icons/cursor-lined.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0"
x:Name="CursorToolbarIconImage" />
<Image RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0"
x:Name="CursorToolbarIconImage">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="CursorIconGeometry" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="SelectionToolBarTextBlock" Text="鼠标" Foreground="Black" FontSize="8"
Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
@ -2535,18 +2606,37 @@
MouseUp="PenIcon_Click"
Background="Transparent" Orientation="Vertical"
HorizontalAlignment="Center" Width="28" Margin="0,-2">
<Image x:Name="PenIcon" Source="/Resources/new-icons/pen-lined.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
<TextBlock x:Name="PenToolbarTextBlock" Text="批注" Foreground="Black" FontSize="8"
<Image x:Name="PenIcon"
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="PenIconGeometry" Brush="Black" Geometry="" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="PenToolbarTextBlock" Text="批注" Foreground="Black" FontSize="8"
Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Name="SymbolIconDelete"
MouseUp="SymbolIconDelete_MouseUp"
Background="Transparent" Orientation="Vertical"
HorizontalAlignment="Center" Width="28" Margin="0,-2">
<Image Source="/Resources/new-icons/trash.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
<TextBlock x:Name="TrashBinToolbarTextBlock" Text="清空" Foreground="#B91C1C"
<Image RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="ClearIconGeometry" Brush="#b91c1c" Geometry="F0 M24,24z M0,0z M10.1573,10.0421C10.7298,10.0421,11.1938,10.5062,11.1938,11.0787L11.1938,16.6067C11.1938,17.1792 10.7298,17.6433 10.1573,17.6433 9.58485,17.6433 9.12079,17.1792 9.12079,16.6067L9.12079,11.0787C9.12079,10.5062,9.58485,10.0421,10.1573,10.0421z M13.8427,10.0421C14.4151,10.0421,14.8792,10.5062,14.8792,11.0787L14.8792,16.6067C14.8792,17.1792 14.4151,17.6433 13.8427,17.6433 13.2702,17.6433 12.8062,17.1792 12.8062,16.6067L12.8062,11.0787C12.8062,10.5062,13.2702,10.0421,13.8427,10.0421z M3.70787,5.43539C3.13541,5.43539 2.67135,5.89946 2.67135,6.47191 2.67135,7.04436 3.13541,7.50843 3.70787,7.50843L4.51405,7.50843 4.51405,19.3708C4.51405,20.1686 4.9025,20.8796 5.39348,21.3706 5.88445,21.8615 6.59548,22.25 7.39326,22.25L16.6067,22.25C17.4045,22.25 18.1155,21.8615 18.6065,21.3706 19.0975,20.8796 19.486,20.1686 19.486,19.3708L19.486,7.50843 20.2921,7.50843C20.8646,7.50843 21.3287,7.04436 21.3287,6.47191 21.3287,5.89946 20.8646,5.43539 20.2921,5.43539L16.7219,5.43539 16.7219,4.62921C16.7219,3.83143 16.3335,3.12041 15.8425,2.62943 15.3515,2.13845 14.6405,1.75 13.8427,1.75L10.1573,1.75C9.35952,1.75 8.6485,2.13845 8.15752,2.62943 7.66654,3.12041 7.27809,3.83143 7.27809,4.62921L7.27809,5.43539 3.70787,5.43539z M6.58708,19.3708C6.58708,19.4944 6.6593,19.7047 6.85933,19.9047 7.05937,20.1047 7.26969,20.177 7.39326,20.177L16.6067,20.177C16.7303,20.177 16.9406,20.1047 17.1407,19.9047 17.3407,19.7047 17.4129,19.4944 17.4129,19.3708L17.4129,7.50843 6.58708,7.50843 6.58708,19.3708z M9.62338,4.09529C9.42334,4.29532,9.35112,4.50565,9.35112,4.62921L9.35112,5.43539 14.6489,5.43539 14.6489,4.62921C14.6489,4.50565 14.5767,4.29532 14.3766,4.09529 14.1766,3.89525 13.9663,3.82303 13.8427,3.82303L10.1573,3.82303C10.0337,3.82303,9.82341,3.89525,9.62338,4.09529z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="TrashBinToolbarTextBlock" Text="清空" Foreground="#B91C1C"
FontWeight="Bold" FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Name="StackPanelCanvasControls" Visibility="Visible"
@ -3231,21 +3321,35 @@
MouseUp="EraserIcon_Click"
Background="Transparent" Orientation="Vertical"
HorizontalAlignment="Center" Margin="0,-2" Width="28">
<Image x:Name="CircleEraserToolbarIconImage"
Source="/Resources/new-icons/circle-eraser-lined.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
<Image x:Name="CircleEraserToolbarIconImage" RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="CircleEraserIconGeometry" Geometry="" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="CircleEraserToolbarTextBlock" Text="面积擦" Foreground="Black"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Name="EraserByStrokes_Icon"
MouseUp="EraserIconByStrokes_Click"
Background="Transparent" Orientation="Vertical" Width="28"
Margin="0,-2" HorizontalAlignment="Center">
<Image x:Name="StrokeEraserToolbarIconImage"
Source="/Resources/new-icons/eraser-lined.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
<Image x:Name="StrokeEraserToolbarIconImage" RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="StrokeEraserIconGeometry" Geometry="" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="InkEraserToolbarTextBlock" Text="线擦" Foreground="Black"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
@ -3253,8 +3357,17 @@
MouseUp="SymbolIconSelect_MouseUp" Background="Transparent"
Orientation="Vertical" Margin="0,-2" Width="28"
HorizontalAlignment="Center">
<Image x:Name="LassoSelect" Source="/Resources/new-icons/lasso-select-lined.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
<Image x:Name="LassoSelect" RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="LassoSelectIconGeometry" Geometry="" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="LassoToolToolbarTextBlock" Text="套索选" Foreground="Black"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
@ -3263,8 +3376,17 @@
MouseUp="ImageDrawShape_MouseUp" Background="Transparent"
Orientation="Vertical" HorizontalAlignment="Center" Margin="0,-2"
Width="28">
<Image Source="/Resources/new-icons/shapes.png"
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
<Image RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="ShapesIconGeometry" Brush="#1b1b1b" Geometry="F0 M24,24z M0,0z M13.0573,17.3383C13.0573,15.0674 14.8982,13.2265 17.169,13.2265 19.4399,13.2265 21.2808,15.0674 21.2808,17.3383 21.2808,19.6091 19.4399,21.45 17.169,21.45 14.8982,21.45 13.0573,19.6091 13.0573,17.3383z M4.48141,13.2265C3.50819,13.2265,2.71924,14.0155,2.71924,14.9887L2.71924,19.6878C2.71924,20.6611,3.50819,21.45,4.48141,21.45L9.18053,21.45C10.1537,21.45,10.9427,20.6611,10.9427,19.6878L10.9427,14.9887C10.9427,14.0155,10.1537,13.2265,9.18053,13.2265L4.48141,13.2265z M12.6923,2.71599C12.4659,2.59866 12.213,2.54181 11.9581,2.55096 11.7033,2.5601 11.4551,2.63494 11.2377,2.7682 11.028,2.89676 10.8537,3.07549 10.7305,3.28809L7.24046,8.83413C7.09431,9.06224 7.01353,9.32612 7.007,9.59703 7.00043,9.86995 7.06945,10.1394 7.20645,10.3755 7.34345,10.6117 7.54308,10.8053 7.78328,10.9351 8.01558,11.0605 8.27707,11.1215 8.5406,11.1119L15.5037,11.1119 15.5065,11.1119C15.7766,11.111 16.0412,11.0362 16.2717,10.8957 16.5023,10.7551 16.6901,10.5542 16.8146,10.3146 16.9392,10.0751 16.9959,9.80598 16.9785,9.53651 16.9617,9.27545 16.876,9.02367 16.7303,8.80672L13.26,3.23562 13.2505,3.22067C13.111,3.00717,12.9187,2.83333,12.6923,2.71599z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="ShapesToolbarTextBlock" Text="几何" Foreground="Black"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
@ -3286,9 +3408,6 @@
<ui:SimpleStackPanel Orientation="Horizontal"
HorizontalAlignment="Stretch">
<Canvas Height="24" Width="315" ClipToBounds="True">
<Image Source="/Resources/new-icons/osu-lazer-triangles.png"
Width="64" Canvas.Right="-20" Canvas.Bottom="-10"
Opacity="0.5" />
<TextBlock Text="几何绘图" Canvas.Left="8" Foreground="White"
Padding="0,5" FontSize="11" FontWeight="Bold"
TextAlignment="Center" />
@ -3498,17 +3617,23 @@
</Border>
</Grid>
<ui:SimpleStackPanel
MouseUp="SymbolIconUndo_MouseUp"
IsHitTestVisible="{Binding ElementName=BtnUndo, Path=IsEnabled}"
Background="Transparent" Orientation="Vertical"
HorizontalAlignment="Center" Margin="0,-2"
IsEnabled="{Binding ElementName=BtnUndo, Path=IsEnabled}"
Width="28">
<Image Source="/Resources/new-icons/undo.png"
RenderOptions.BitmapScalingMode="HighQuality" Width="28"
Opacity="{Binding ElementName=BtnUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"
Height="17" Margin="0,3,0,0" />
<Image RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0"
Opacity="{Binding ElementName=BtnUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="UndoIconGeometry" Brush="#1b1b1b" Geometry="F1 M24,24z M0,0z M9.70711,6.70711C10.0976,6.31658 10.0976,5.68342 9.70711,5.29289 9.31658,4.90237 8.68342,4.90237 8.29289,5.29289L4.29289,9.29289C3.90237,9.68342,3.90237,10.3166,4.29289,10.7071L8.29289,14.7071C8.68342,15.0976 9.31658,15.0976 9.70711,14.7071 10.0976,14.3166 10.0976,13.6834 9.70711,13.2929L7.40633,10.9921 16,11C16.7956,11 17.5587,11.3161 18.1213,11.8787 18.6839,12.4413 19,13.2044 19,14 19,14.7956 18.6839,15.5587 18.1213,16.1213 17.5587,16.6839 16.7956,17 16,17L15,17C14.4477,17 14,17.4477 14,18 14,18.5523 14.4477,19 15,19L16,19C17.3261,19 18.5979,18.4732 19.5355,17.5355 20.4732,16.5979 21,15.3261 21,14 21,12.6739 20.4732,11.4021 19.5355,10.4645 18.5979,9.52678 17.3261,9 16,9L7.40633,9.00789 9.70711,6.70711z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="UndoToolbarTextBlock" Text="撤销"
Opacity="{Binding ElementName=BtnUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"
Foreground="Black" FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
@ -3516,15 +3641,22 @@
<ui:SimpleStackPanel
MouseUp="SymbolIconRedo_MouseUp"
IsHitTestVisible="{Binding ElementName=BtnUndo, Path=IsEnabled}"
Background="Transparent" Orientation="Vertical"
HorizontalAlignment="Center"
IsEnabled="{Binding ElementName=BtnRedo, Path=IsEnabled}"
Width="28" Margin="0,-2">
<Image Source="/Resources/new-icons/redo.png"
RenderOptions.BitmapScalingMode="HighQuality" Width="28"
Opacity="{Binding ElementName=BtnRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"
Height="17" Margin="0,3,0,0" />
<Image RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0"
Opacity="{Binding ElementName=BtnRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing x:Name="RedoIconGeometry" Brush="#1b1b1b" Geometry="F1 M24,24z M0,0z M15.2929,6.70711C14.9024,6.31658 14.9024,5.68342 15.2929,5.29289 15.6834,4.90237 16.3166,4.90237 16.7071,5.29289L20.7071,9.29289C21.0976,9.68342,21.0976,10.3166,20.7071,10.7071L16.7071,14.7071C16.3166,15.0976 15.6834,15.0976 15.2929,14.7071 14.9024,14.3166 14.9024,13.6834 15.2929,13.2929L17.5937,10.9921 9,11C8.20435,11 7.44129,11.3161 6.87868,11.8787 6.31607,12.4413 6,13.2044 6,14 6,14.7956 6.31607,15.5587 6.87868,16.1213 7.44129,16.6839 8.20435,17 9,17L10,17C10.5523,17 11,17.4477 11,18 11,18.5523 10.5523,19 10,19L9,19C7.67392,19 6.40215,18.4732 5.46447,17.5355 4.52679,16.5979 4,15.3261 4,14 4,12.6739 4.52678,11.4021 5.46447,10.4645 6.40215,9.52678 7.67392,9 9,9L17.5937,9.00789 15.2929,6.70711z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="RedoToolbarTextBlock" Text="重做"
Opacity="{Binding ElementName=BtnRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"
Foreground="Black" FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
@ -3549,8 +3681,6 @@
<Border BorderBrush="#1e3a8a" BorderThickness="0,0,0,1" CornerRadius="6,6,0,0"
Background="#2563eb" Margin="-1,-1,-1,1">
<Canvas Height="24" ClipToBounds="True">
<Image Source="/Resources/new-icons/osu-lazer-triangles.png" Width="64"
Canvas.Right="-20" Canvas.Bottom="-10" Opacity="0.5" />
<TextBlock Text="橡皮选项" Canvas.Left="8" Foreground="White" Padding="0,5"
FontSize="11" FontWeight="Bold" TextAlignment="Center" />
</Canvas>
@ -3813,8 +3943,6 @@
<Border BorderBrush="#1e3a8a" BorderThickness="0,0,0,1" CornerRadius="6,6,0,0"
Background="#2563eb" Margin="-1,-1,-1,1">
<Canvas Height="24" ClipToBounds="True">
<Image Source="/Resources/new-icons/osu-lazer-triangles.png" Width="64"
Canvas.Right="-20" Canvas.Bottom="-10" Opacity="0.5" />
<TextBlock Text="手势选项" Canvas.Left="8" Foreground="White" Padding="0,5"
FontSize="11" FontWeight="Bold" TextAlignment="Center" />
</Canvas>

View File

@ -193,11 +193,11 @@ namespace Ink_Canvas
await Dispatcher.InvokeAsync(() => {
if (StackPanelPPTControls.Visibility == Visibility.Visible)
{
if (Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel)
if (Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel && isDisplayingOrHidingBlackboard == false)
{
AnimationsHelper.ShowWithSlideFromBottomAndFade(BottomViewboxPPTSidesControl);
}
if (Settings.PowerPointSettings.IsShowSidePPTNavigationPanel)
if (Settings.PowerPointSettings.IsShowSidePPTNavigationPanel && isDisplayingOrHidingBlackboard == false)
{
AnimationsHelper.ShowWithScaleFromLeft(LeftSidePanelForPPTNavigation);
AnimationsHelper.ShowWithScaleFromRight(RightSidePanelForPPTNavigation);

View File

@ -21,7 +21,7 @@ namespace Ink_Canvas
private void ColorSwitchCheck()
{
HideSubPanels("color");
if (Main_Grid.Background == Brushes.Transparent)
if (GridTransparencyFakeBackground.Background == Brushes.Transparent)
{
if (currentMode == 1)
{

View File

@ -167,7 +167,7 @@ namespace Ink_Canvas
}
#region
private async void HideSubPanels(String mode = null, bool autoAlignCenter = false)
private async void HideSubPanels(String mode = null, bool autoAlignCenter = false, bool isAutoUpdateToolbarSelection = true)
{
AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
@ -177,14 +177,14 @@ namespace Ink_Canvas
if (BorderSettings.Visibility == Visibility.Visible)
{
// hide settings panel using new animation
BorderSettingsMask.IsHitTestVisible = false;
BorderSettingsMask.Background = null;
var sb = new Storyboard();
// 滑动动画
var slideAnimation = new DoubleAnimation
{
From = 0,
From = 0, // 滑动距离
To = BorderSettings.RenderTransform.Value.OffsetX - 440,
Duration = TimeSpan.FromSeconds(0.6)
};
@ -196,11 +196,13 @@ namespace Ink_Canvas
sb.Completed += (s, _) =>
{
BorderSettings.Visibility = Visibility.Collapsed;
isOpeningOrHidingSettingsPane = false;
};
BorderSettings.Visibility = Visibility.Visible;
BorderSettings.RenderTransform = new TranslateTransform();
isOpeningOrHidingSettingsPane = true;
sb.Begin((FrameworkElement)BorderSettings);
}
@ -213,80 +215,49 @@ namespace Ink_Canvas
AnimationsHelper.HideWithSlideAndFade(BoardBorderDrawShape);
}
if (mode != null)
if (mode != null && isAutoUpdateToolbarSelection==true)
{
if (mode != "clear")
{
Pen_Icon.Background = null;
BoardPen.Background = new SolidColorBrush(Colors.LightGray);
Eraser_Icon.Background = null;
BoardEraser.Background = new SolidColorBrush(Colors.LightGray);
SymbolIconSelect.Background = null;
BoardSelect.Background = new SolidColorBrush(Colors.LightGray);
EraserByStrokes_Icon.Background = null;
BoardEraserByStrokes.Background = new SolidColorBrush(Colors.LightGray);
ImageSource cursorSolidIS = new BitmapImage(new Uri("/Resources/new-icons/cursor-solid.png", UriKind.Relative));
ImageSource penLinedIS = new BitmapImage(new Uri("/Resources/new-icons/pen-lined.png", UriKind.Relative));
ImageSource strokeEraserLinedIS = new BitmapImage(new Uri("/Resources/new-icons/eraser-lined.png", UriKind.Relative));
ImageSource circleEraserLinedIS = new BitmapImage(new Uri("/Resources/new-icons/circle-eraser-lined.png", UriKind.Relative));
ImageSource selectLinedIS = new BitmapImage(new Uri("/Resources/new-icons/lasso-select-lined.png", UriKind.Relative));
// 修改鼠标icon为solid
CursorToolbarIconImage.Source = cursorSolidIS;
// 修改批注icon为lined
PenIcon.Source = penLinedIS;
// 修改笔记擦icon为lined
StrokeEraserToolbarIconImage.Source = strokeEraserLinedIS;
// 修改擦icon为lined
CircleEraserToolbarIconImage.Source = circleEraserLinedIS;
// 修改select icon为lined
LassoSelect.Source = selectLinedIS;
CursorIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(27, 27, 27));
CursorIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.LinedCursorIcon);
PenIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(27, 27, 27));
PenIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.LinedPenIcon);
StrokeEraserIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(27, 27, 27));
StrokeEraserIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.LinedEraserStrokeIcon);
CircleEraserIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(27, 27, 27));
CircleEraserIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.LinedEraserCircleIcon);
LassoSelectIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(27, 27, 27));
LassoSelectIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.LinedLassoSelectIcon);
}
switch (mode)
{
case "pen":
case "color":
{
BoardPen.Background = new SolidColorBrush(Color.FromRgb(103, 156, 244));
Pen_Icon.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/check-box-background.png"))) { Opacity = 1 };
ImageSource penSolidIS = new BitmapImage(new Uri("/Resources/new-icons/pen-solid.png", UriKind.Relative));
// 修改批注icon为solid
PenIcon.Source = penSolidIS;
PenIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
PenIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.SolidPenIcon);
break;
}
case "eraser":
{
Eraser_Icon.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/check-box-background.png"))) { Opacity = 1 };
BoardEraser.Background = new SolidColorBrush(Color.FromRgb(103, 156, 244));
ImageSource circleEraserSolidIS = new BitmapImage(new Uri("/Resources/new-icons/circle-eraser-solid.png", UriKind.Relative));
// 修改擦icon为solid
CircleEraserToolbarIconImage.Source = circleEraserSolidIS;
break;
}
{
CircleEraserIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
CircleEraserIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.SolidEraserCircleIcon);
break;
}
case "eraserByStrokes":
{
EraserByStrokes_Icon.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/check-box-background.png"))) { Opacity = 1 };
BoardEraserByStrokes.Background = new SolidColorBrush(Color.FromRgb(103, 156, 244));
ImageSource strokeEraserSolidIS = new BitmapImage(new Uri("/Resources/new-icons/eraser-solid.png", UriKind.Relative));
// 修改笔记擦icon为solid
StrokeEraserToolbarIconImage.Source = strokeEraserSolidIS;
break;
}
{
StrokeEraserIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
StrokeEraserIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.SolidEraserStrokeIcon);
break;
}
case "select":
{
BoardSelect.Background = new SolidColorBrush(Color.FromRgb(103, 156, 244));
SymbolIconSelect.Background = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/Resources/Icons-png/check-box-background.png"))) { Opacity = 1 };
ImageSource selectSolidIS = new BitmapImage(new Uri("/Resources/new-icons/lasso-select-solid.png", UriKind.Relative));
// 修改select icon为solid
LassoSelect.Source = selectSolidIS;
break;
}
{
LassoSelectIconGeometry.Brush = new SolidColorBrush(Color.FromRgb(30, 58, 138));
LassoSelectIconGeometry.Geometry = Geometry.Parse(XamlGraphicsIconGeometries.SolidLassoSelectIcon);
break;
}
}
@ -309,6 +280,7 @@ namespace Ink_Canvas
}
}
}
await Task.Delay(150);
isHidingSubPanelsWhenInking = false;
}
@ -354,7 +326,7 @@ namespace Ink_Canvas
private void SymbolIconUndo_MouseUp(object sender, MouseButtonEventArgs e)
{
if (lastBorderMouseDownObject != sender) return;
//if (lastBorderMouseDownObject != sender) return;
if (!BtnUndo.IsEnabled) return;
BtnUndo_Click(BtnUndo, null);
@ -363,7 +335,7 @@ namespace Ink_Canvas
private void SymbolIconRedo_MouseUp(object sender, MouseButtonEventArgs e)
{
if (lastBorderMouseDownObject != sender) return;
//if (lastBorderMouseDownObject != sender) return;
if (!BtnRedo.IsEnabled) return;
BtnRedo_Click(BtnRedo, null);
@ -411,6 +383,7 @@ namespace Ink_Canvas
private void SymbolIconSettings_Click(object sender, RoutedEventArgs e)
{
if (isOpeningOrHidingSettingsPane != false) return;
HideSubPanels();
BtnSettings_Click(null, null);
}
@ -437,10 +410,11 @@ namespace Ink_Canvas
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
UnFoldFloatingBar_MouseUp(null, null);
if (isDisplayingOrHidingBlackboard) return;
isDisplayingOrHidingBlackboard = true;
UnFoldFloatingBar_MouseUp(null, null);
if (inkCanvas.EditingMode == InkCanvasEditingMode.Select) PenIcon_Click(null, null);
if (currentMode == 0)
@ -881,9 +855,8 @@ namespace Ink_Canvas
}
}
Main_Grid.Background = Brushes.Transparent;
GridTransparencyFakeBackground.Opacity = 0;
GridTransparencyFakeBackground.Background = Brushes.Transparent;
GridBackgroundCoverHolder.Visibility = Visibility.Collapsed;
inkCanvas.Select(new StrokeCollection());
@ -937,7 +910,8 @@ namespace Ink_Canvas
{
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
Main_Grid.Background = new SolidColorBrush(StringToColor("#01FFFFFF"));
GridTransparencyFakeBackground.Opacity = 1;
GridTransparencyFakeBackground.Background = new SolidColorBrush(StringToColor("#01FFFFFF"));
inkCanvas.IsHitTestVisible = true;
inkCanvas.Visibility = Visibility.Visible;
@ -1470,38 +1444,17 @@ namespace Ink_Canvas
private void SettingsOverlayClick(object sender, MouseButtonEventArgs e)
{
if (isOpeningOrHidingSettingsPane==true) return;
BtnSettings_Click(null, null);
}
private bool isOpeningOrHidingSettingsPane = false;
private void BtnSettings_Click(object sender, RoutedEventArgs e)
{
if (BorderSettings.Visibility == Visibility.Visible)
{
BorderSettingsMask.IsHitTestVisible = false;
BorderSettingsMask.Background = null;
var sb = new Storyboard();
// 滑动动画
var slideAnimation = new DoubleAnimation
{
From = 0, // 滑动距离
To = BorderSettings.RenderTransform.Value.OffsetX - 440,
Duration = TimeSpan.FromSeconds(0.6)
};
slideAnimation.EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut };
Storyboard.SetTargetProperty(slideAnimation, new PropertyPath("(UIElement.RenderTransform).(TranslateTransform.X)"));
sb.Children.Add(slideAnimation);
sb.Completed += (s, _) =>
{
BorderSettings.Visibility = Visibility.Collapsed;
};
BorderSettings.Visibility = Visibility.Visible;
BorderSettings.RenderTransform = new TranslateTransform();
sb.Begin((FrameworkElement)BorderSettings);
HideSubPanels();
}
else
{
@ -1522,9 +1475,15 @@ namespace Ink_Canvas
sb.Children.Add(slideAnimation);
sb.Completed += (s, _) =>
{
isOpeningOrHidingSettingsPane = false;
};
BorderSettings.Visibility = Visibility.Visible;
BorderSettings.RenderTransform = new TranslateTransform();
isOpeningOrHidingSettingsPane = true;
sb.Begin((FrameworkElement)BorderSettings);
}
}
@ -1612,7 +1571,7 @@ namespace Ink_Canvas
private void BtnSwitch_Click(object sender, RoutedEventArgs e)
{
if (Main_Grid.Background == Brushes.Transparent)
if (GridTransparencyFakeBackground.Background == Brushes.Transparent)
{
if (currentMode == 0)
{
@ -1730,9 +1689,10 @@ namespace Ink_Canvas
private void BtnHideInkCanvas_Click(object sender, RoutedEventArgs e)
{
if (Main_Grid.Background == Brushes.Transparent)
if (GridTransparencyFakeBackground.Background == Brushes.Transparent)
{
Main_Grid.Background = new SolidColorBrush(StringToColor("#01FFFFFF"));
GridTransparencyFakeBackground.Opacity = 1;
GridTransparencyFakeBackground.Background = new SolidColorBrush(StringToColor("#01FFFFFF"));
inkCanvas.IsHitTestVisible = true;
inkCanvas.Visibility = Visibility.Visible;
@ -1810,7 +1770,8 @@ namespace Ink_Canvas
}
}
Main_Grid.Background = Brushes.Transparent;
GridTransparencyFakeBackground.Opacity = 0;
GridTransparencyFakeBackground.Background = Brushes.Transparent;
GridBackgroundCoverHolder.Visibility = Visibility.Collapsed;
@ -1833,7 +1794,7 @@ namespace Ink_Canvas
BtnHideInkCanvas.Content = "显示\n画板";
}
if (Main_Grid.Background == Brushes.Transparent)
if (GridTransparencyFakeBackground.Background == Brushes.Transparent)
{
StackPanelCanvasControls.Visibility = Visibility.Collapsed;
CheckEnableTwoFingerGestureBtnVisibility(false);

View File

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ink_Canvas
{
public static class XamlGraphicsIconGeometries
{
public static string LinedCursorIcon =
"F0 M24,24z M0,0z M3.85151,2.7073C3.52422,2.57095 3.147,2.64558 2.89629,2.89629 2.64558,3.147 2.57095,3.52422 2.7073,3.85151L9.7773,20.8215C9.91729,21.1575 10.2507,21.3718 10.6145,21.3595 10.9783,21.3473 11.2965,21.1111 11.4135,20.7664L13.4711,14.7085 18.8963,20.1337C19.238,20.4754 19.792,20.4754 20.1337,20.1337 20.4754,19.792 20.4754,19.238 20.1337,18.8963L14.7085,13.4711 20.7664,11.4135C21.1111,11.2965 21.3473,10.9783 21.3595,10.6145 21.3718,10.2507 21.1575,9.91729 20.8215,9.7773L3.85151,2.7073z M10.5017,18.0097L5.13984,5.13984 18.0097,10.5017 12.8136,12.2665C12.5561,12.3539,12.3539,12.5561,12.2665,12.8136L10.5017,18.0097z";
public static string SolidCursorIcon =
"F0 M24,24z M0,0z M2.89629,2.89629C3.147,2.64558,3.52422,2.57095,3.85151,2.7073L20.8215,9.7773C21.1575,9.91729 21.3718,10.2507 21.3595,10.6145 21.3473,10.9783 21.1111,11.2965 20.7664,11.4135L14.7085,13.4711 20.1337,18.8963C20.4754,19.238 20.4754,19.792 20.1337,20.1337 19.792,20.4754 19.238,20.4754 18.8963,20.1337L13.4711,14.7085 11.4135,20.7664C11.2965,21.1111 10.9783,21.3473 10.6145,21.3595 10.2507,21.3718 9.91729,21.1575 9.7773,20.8215L2.7073,3.85151C2.57095,3.52422,2.64558,3.147,2.89629,2.89629z";
public static string LinedPenIcon =
"F0 M24,24z M0,0z M18.7033,4.39761C18.4948,4.31644 18.2714,4.27922 18.0473,4.28846 17.8233,4.29771 17.6038,4.3532 17.403,4.4512 17.2022,4.54919 17.0246,4.68744 16.8813,4.8568 16.8665,4.87422 16.8511,4.89102 16.8349,4.90716L15.7108,6.03131 17.9591,8.27962 19.0832,7.15546C19.1021,7.13662 19.1218,7.11869 19.1424,7.10176 19.3143,6.96037 19.4543,6.7853 19.5537,6.58793 19.6531,6.39058 19.7099,6.1751 19.7207,5.95519 19.7314,5.73528 19.6959,5.51545 19.6163,5.30962 19.5367,5.10378 19.4147,4.91625 19.2576,4.75914 19.1004,4.60201 18.9117,4.47877 18.7033,4.39761z M16.7944,9.44428L14.5461,7.19597 5.47079,16.2713 4.62767,19.3627 7.7191,18.5196 16.7944,9.44428z M13.9636,5.44913L4.15148,15.2613C4.05014,15.3626,3.977,15.4886,3.93929,15.6269L2.65942,20.3198C2.58166,20.6049 2.66264,20.9098 2.87161,21.1188 3.08059,21.3277 3.38551,21.4087 3.67063,21.331L8.36347,20.0511C8.50174,20.0134,8.62777,19.9402,8.72911,19.8389L20.2217,8.34636C20.5551,8.06468 20.8283,7.71873 21.0247,7.3289 21.2275,6.92628 21.3437,6.48586 21.3658,6.03572 21.3878,5.58559 21.3151,5.13594 21.1525,4.71552 20.99,4.29512 20.7411,3.91338 20.4222,3.59447 20.1033,3.27558 19.7214,3.0265 19.3009,2.86277 18.8804,2.69905 18.4304,2.62417 17.9794,2.64278 17.5285,2.66139 17.0862,2.77308 16.6807,2.97095 16.2862,3.16344 15.9348,3.43348 15.6478,3.76494L13.9636,5.44913z";
public static string SolidPenIcon =
"F1 M24,24z M0,0z M19.3332,2.85933C18.9193,2.69814 18.4762,2.62442 18.0322,2.64274 17.5882,2.66106 17.1527,2.77103 16.7535,2.96583 16.3643,3.15575 16.0177,3.42232 15.7349,3.74956L14.5672,4.91725 19.0731,9.4231 20.2373,8.25888C20.5666,7.98121 20.8364,7.63993 21.0302,7.25528 21.2298,6.85899 21.3442,6.42551 21.3659,5.98249 21.3876,5.53947 21.3161,5.09692 21.1561,4.68313 20.996,4.26934 20.7511,3.89359 20.4372,3.57966 20.1232,3.26574 19.7472,3.02052 19.3332,2.85933z M18.0085,10.4877L13.5026,5.98183 4.14128,15.3432C4.04864,15.4358,3.98179,15.551,3.94732,15.6774L2.65684,20.4091C2.58577,20.6698 2.65979,20.9485 2.8508,21.1395 3.04182,21.3305 3.32054,21.4045 3.58117,21.3335L8.3129,20.043C8.43929,20.0085,8.5545,19.9417,8.64713,19.849L18.0085,10.4877z";
public static string LinedEraserStrokeIcon =
"F0 M25,24z M0,0z M7.32029,21.36L13.0098,21.36 13.0122,21.36 21.5471,21.36C21.989,21.36 22.3473,21.0017 22.3473,20.5598 22.3473,20.1179 21.989,19.7596 21.5471,19.7596L14.9429,19.7596 21.4352,13.2673C22.7372,12.0786,22.6872,10.1353,21.449,8.89707L16.1515,3.59952C14.9628,2.29751,13.0195,2.34754,11.7813,3.58572L2.68992,12.6771C1.3879,13.8657,1.43793,15.8091,2.67611,17.0473L6.75447,21.1256C6.90453,21.2757,7.10807,21.36,7.32029,21.36z M14.9771,4.68685C14.4571,4.10907,13.5664,4.06392,12.9129,4.71737L6.55503,11.0753 13.9595,18.4797 20.3174,12.1218C20.3273,12.1119 20.3375,12.1022 20.3479,12.0929 20.9257,11.5729 20.9708,10.6822 20.3174,10.0287L15.006,4.71737C14.9961,4.70745,14.9864,4.69727,14.9771,4.68685z M12.8278,19.6114L5.42338,12.2069 3.80776,13.8225C3.79784,13.8324 3.78766,13.8421 3.77724,13.8515 3.19947,14.3715 3.15431,15.2622 3.80776,15.9156L7.65174,19.7596 12.6796,19.7596 12.8278,19.6114z";
public static string SolidEraserStrokeIcon =
"F1 M24,24z M0,0z M11.6199,3.61372C12.8916,2.34202,14.8995,2.2837,16.1307,3.62964L21.3433,8.84225C22.615,10.1139,22.6733,12.1218,21.3274,13.353L15.1877,19.4927 5.46434,9.76928 11.6199,3.61372z M7.33167,21.36C7.08919,21.36 6.86831,21.2676 6.70232,21.116 6.69184,21.1064 6.68155,21.0966 6.67147,21.0865L2.65671,17.0718C1.385,15.8001,1.32668,13.7922,2.67262,12.561L4.14394,11.0897 12.5469,19.4927 21.3367,19.4927C21.8523,19.4927 22.2703,19.9107 22.2703,20.4263 22.2703,20.942 21.8523,21.36 21.3367,21.36L7.33167,21.36z";
public static string LinedEraserCircleIcon =
"F0 M25,24z M0,0z M2.47995,17.1206L6.56736,21.208C6.57733,21.218 6.58749,21.2277 6.59783,21.237 6.66429,21.2971 6.7405,21.3466 6.82381,21.3829L6.83712,21.3885C6.84698,21.3926 6.85693,21.3965 6.86698,21.4003 6.86818,21.4007 6.86937,21.4011 6.87057,21.4016 6.94576,21.4289 7.02412,21.4451 7.10303,21.45L7.12183,21.451 7.13076,21.4513 7.13345,21.4514 7.15549,21.4517 17.0847,21.4517C17.5973,22.3438 18.5597,22.9445 19.6624,22.9445 21.3031,22.9445 22.6332,21.6144 22.6332,19.9737 22.6332,18.3329 21.3031,17.0028 19.6624,17.0028 18.0839,17.0028 16.793,18.2338 16.6972,19.7882L14.8669,19.7882 21.3224,13.3327C22.6404,12.1289,22.5884,10.1619,21.3367,8.91021L16.0278,3.60138C14.8241,2.28336,12.8571,2.33535,11.6053,3.58706L2.49426,12.6981C1.17625,13.9019,1.22824,15.8689,2.47995,17.1206z M14.8072,4.7316C14.2984,4.16633,13.4255,4.11939,12.7816,4.76332L6.43063,11.1143 13.8094,18.4931 20.1604,12.1421C20.1707,12.1318 20.1813,12.1218 20.1921,12.112 20.7574,11.6033 20.8043,10.7304 20.1604,10.0865L14.8373,4.76332C14.8269,4.75301,14.8169,4.74243,14.8072,4.7316z M3.65621,13.8887C3.6459,13.899 3.63532,13.9091 3.62448,13.9188 3.05922,14.4276 3.01228,15.3004 3.65621,15.9444L7.50001,19.7882 12.752,19.7882 5.25437,12.2906 3.65621,13.8887z";
public static string SolidEraserCircleIcon =
"F1 M24,24z M0,0z M15.0919,19.6686L21.4282,13.3322C22.7462,12.1285,22.6942,10.1616,21.4426,8.90993L16.134,3.60133C14.9303,2.28338,12.9633,2.33537,11.7117,3.58702L5.36097,9.93771 15.0919,19.6686z M6.67201,21.2053C6.82267,21.3569,7.03137,21.4508,7.26201,21.4508L17.1907,21.4508C17.7033,22.3429 18.6657,22.9437 19.7683,22.9437 21.409,22.9437 22.7391,21.6136 22.7391,19.9729 22.7391,18.3322 21.409,17.0022 19.7683,17.0022 18.19,17.0022 16.8991,18.2331 16.8033,19.7874L12.8583,19.7874 4.18476,11.1139 2.60098,12.6977C1.28303,13.9014,1.33502,15.8683,2.58667,17.12L6.67201,21.2053z";
public static string LinedLassoSelectIcon =
"F0 M24,24z M0,0z M14.4715,12.7092L14.4715,18.7882 15.8291,16.7546C15.9688,16.5453,16.2038,16.4196,16.4554,16.4196L19.0106,16.4196 14.4715,12.7092z M14.6618,10.9193C14.4981,10.784 14.2733,10.6788 14.0025,10.6788 13.9951,10.6788 13.9877,10.6789 13.9803,10.6791 13.7083,10.6872 13.4502,10.8008 13.2607,10.9961 13.0712,11.1913 12.9653,11.4526 12.9653,11.7246L12.9653,20.3314C12.9653,20.3403 12.9655,20.3491 12.9658,20.358 12.9734,20.5733 13.0468,20.7811 13.176,20.9534 13.3053,21.1258 13.4842,21.2544 13.6888,21.3219 13.765,21.3471 13.8447,21.36 13.925,21.36L14.0025,21.36C14.1661,21.36 14.3276,21.3218 14.474,21.2486 14.6204,21.1754 14.7477,21.0692 14.8459,20.9382 14.8542,20.9272 14.8622,20.9159 14.8698,20.9045L16.8582,17.9258 20.3145,17.9258C20.5287,17.9281 20.7384,17.8641 20.9149,17.7424 21.0941,17.6187 21.2299,17.4417 21.3029,17.2365 21.3759,17.0313 21.3825,16.8084 21.3217,16.5993 21.262,16.3936 21.14,16.2117 20.9729,16.0782L14.6618,10.9193z M8.14548,20.0044C7.70454,19.6737 7.34665,19.2448 7.10016,18.7519 6.94658,18.4447 6.83887,18.1179 6.7795,17.7818 7.131,17.6605 7.45404,17.4604 7.72196,17.1924 7.74959,17.1648 7.7765,17.1366 7.80267,17.1078 8.5567,17.4118 9.3392,17.6365 10.1444,17.7694 10.5548,17.8372 10.9424,17.5594 11.0101,17.149 11.0779,16.7387 10.8001,16.3511 10.3897,16.2833 9.72172,16.1731 9.06686,15.9883 8.42926,15.7362 8.44084,15.6393 8.44672,15.5413 8.44672,15.4427 8.44672,14.7865 8.18602,14.1571 7.72196,13.693 7.25791,13.229 6.62852,12.9682 5.97224,12.9682 5.65536,12.9682 5.34474,13.029 5.05598,13.1441 4.47073,12.3026 4.15196,11.303 4.14328,10.2756 4.14532,7.03688 7.49758,4.1462 11.9971,4.1462 16.4941,4.1462 19.8451,7.03371 19.8508,10.2703 19.8388,10.7807 19.7549,11.2869 19.6016,11.7739 19.4767,12.1706 19.697,12.5934 20.0938,12.7183 20.4905,12.8432 20.9134,12.6228 21.0383,12.2261 21.2351,11.6008 21.3424,10.9507 21.3568,10.2952L21.357,10.2786C21.357,5.91009 16.9982,2.64 11.9971,2.64 6.9959,2.64 2.63705,5.91009 2.63705,10.2786L2.6371,10.2845C2.6479,11.6579 3.08647,12.993 3.89074,14.1047 3.63615,14.5007 3.49777,14.9646 3.49777,15.4427 3.49777,16.099 3.75847,16.7284 4.22252,17.1924 4.51465,17.4846 4.87229,17.6961 5.26092,17.8128 5.33333,18.3726 5.49917,18.9179 5.75297,19.4255 6.10404,20.1276 6.61375,20.7383 7.24176,21.2093 7.5745,21.4589 8.04654,21.3915 8.2961,21.0587 8.54566,20.726 8.47822,20.2539 8.14548,20.0044z M5.97224,14.4745C5.71544,14.4745 5.46916,14.5765 5.28757,14.7581 5.10598,14.9396 5.00397,15.1859 5.00397,15.4427 5.00397,15.6995 5.10598,15.9458 5.28757,16.1274 5.46916,16.309 5.71544,16.411 5.97224,16.411 6.22904,16.411 6.47533,16.309 6.65692,16.1274 6.8385,15.9458 6.94052,15.6995 6.94052,15.4427 6.94052,15.1859 6.8385,14.9396 6.65692,14.7581 6.47533,14.5765 6.22904,14.4745 5.97224,14.4745z";
public static string SolidLassoSelectIcon =
"F1 M24,24z M0,0z M14.6618,10.9193C14.4981,10.784 14.2733,10.6788 14.0025,10.6788 13.9951,10.6788 13.9877,10.6789 13.9803,10.6791 13.7083,10.6872 13.4502,10.8008 13.2607,10.9961 13.0712,11.1913 12.9653,11.4526 12.9653,11.7246L12.9653,20.3314C12.9653,20.3403 12.9655,20.3491 12.9658,20.358 12.9734,20.5733 13.0468,20.7811 13.176,20.9534 13.3053,21.1258 13.4842,21.2544 13.6888,21.3219 13.765,21.3471 13.8447,21.36 13.925,21.36L14.0025,21.36C14.1661,21.36 14.3276,21.3218 14.474,21.2486 14.6204,21.1754 14.7477,21.0692 14.8459,20.9382 14.8542,20.9272 14.8622,20.9159 14.8698,20.9045L16.8582,17.9258 20.3145,17.9258C20.5287,17.9281 20.7384,17.8641 20.9149,17.7424 21.0941,17.6187 21.2299,17.4417 21.3029,17.2365 21.3759,17.0313 21.3825,16.8084 21.3217,16.5993 21.262,16.3936 21.14,16.2117 20.9729,16.0782L14.6618,10.9193z M8.14548,20.0044C7.70454,19.6737 7.34665,19.2448 7.10016,18.7519 6.94658,18.4447 6.83888,18.1179 6.7795,17.7818 7.131,17.6605 7.45404,17.4604 7.72196,17.1924 7.74959,17.1648 7.77649,17.1366 7.80267,17.1078 8.5567,17.4118 9.3392,17.6365 10.1444,17.7694 10.5548,17.8372 10.9424,17.5594 11.0101,17.149 11.0779,16.7387 10.8001,16.3511 10.3897,16.2833 9.72172,16.1731 9.06686,15.9883 8.42926,15.7362 8.44084,15.6393 8.44672,15.5413 8.44672,15.4427 8.44672,14.7865 8.18602,14.1571 7.72196,13.693 7.25791,13.229 6.62852,12.9682 5.97224,12.9682 5.65536,12.9682 5.34474,13.029 5.05598,13.1441 4.47073,12.3026 4.15196,11.303 4.14328,10.2756 4.14532,7.03688 7.49758,4.1462 11.9971,4.1462 16.4941,4.1462 19.8451,7.03371 19.8508,10.2703 19.8388,10.7807 19.7549,11.2869 19.6016,11.7739 19.4767,12.1706 19.697,12.5934 20.0938,12.7183 20.4905,12.8432 20.9134,12.6228 21.0383,12.2261 21.2351,11.6008 21.3424,10.9507 21.3568,10.2952L21.357,10.2786C21.357,5.91009 16.9982,2.64 11.9971,2.64 6.9959,2.64 2.63705,5.91009 2.63705,10.2786L2.6371,10.2845C2.6479,11.6579 3.08647,12.993 3.89074,14.1047 3.63615,14.5007 3.49777,14.9646 3.49777,15.4427 3.49777,16.099 3.75847,16.7284 4.22252,17.1924 4.51465,17.4846 4.87229,17.6961 5.26092,17.8128 5.33333,18.3726 5.49917,18.9178 5.75297,19.4255 6.10404,20.1276 6.61375,20.7383 7.24176,21.2093 7.5745,21.4589 8.04654,21.3915 8.2961,21.0587 8.54566,20.726 8.47822,20.2539 8.14548,20.0044z";
}
}

View File

@ -318,7 +318,7 @@ namespace Ink_Canvas {
ViewboxFloatingBar.Opacity = 0.5;
}
if (Settings.PowerPointSettings.IsShowCanvasAtNewSlideShow && Main_Grid.Background == Brushes.Transparent) {
if (Settings.PowerPointSettings.IsShowCanvasAtNewSlideShow && GridTransparencyFakeBackground.Background == Brushes.Transparent) {
if (currentMode != 0) {
currentMode = 0;
GridBackgroundCover.Visibility = Visibility.Collapsed;
@ -439,7 +439,7 @@ namespace Ink_Canvas {
ClearStrokes(true);
if (Main_Grid.Background != Brushes.Transparent) {
if (GridTransparencyFakeBackground.Background != Brushes.Transparent) {
BtnHideInkCanvas_Click(BtnHideInkCanvas, null);
}
@ -552,7 +552,8 @@ namespace Ink_Canvas {
private async void PPTNavigationBtn_Click(object sender, MouseButtonEventArgs e) {
if (lastBorderMouseDownObject != sender) return;
Main_Grid.Background = new SolidColorBrush(StringToColor("#01FFFFFF"));
GridTransparencyFakeBackground.Opacity = 1;
GridTransparencyFakeBackground.Background = new SolidColorBrush(StringToColor("#01FFFFFF"));
CursorIcon_Click(null, null);
try {
pptApplication.SlideShowWindows[1].SlideNavigation.Visible = true;

View File

@ -457,6 +457,14 @@ namespace Ink_Canvas {
StartOrStoptimerCheckAutoFold();
}
private void ToggleSwitchAutoFoldInHiteLightBoard_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.Automation.IsAutoFoldInHiteLightBoard = ToggleSwitchAutoFoldInHiteLightBoard.IsOn;
SaveSettingsToFile();
StartOrStoptimerCheckAutoFold();
}
private void ToggleSwitchAutoFoldInHiteCamera_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Automation.IsAutoFoldInHiteCamera = ToggleSwitchAutoFoldInHiteCamera.IsOn;
@ -508,13 +516,28 @@ namespace Ink_Canvas {
if (!isLoaded) return;
Settings.Automation.IsAutoKillEasiNote = ToggleSwitchAutoKillEasiNote.IsOn;
SaveSettingsToFile();
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService) {
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService || Settings.Automation.IsAutoKillHiteAnnotation) {
timerKillProcess.Start();
} else {
timerKillProcess.Stop();
}
}
private void ToggleSwitchAutoKillHiteAnnotation_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.Automation.IsAutoKillHiteAnnotation = ToggleSwitchAutoKillHiteAnnotation.IsOn;
SaveSettingsToFile();
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService || Settings.Automation.IsAutoKillHiteAnnotation)
{
timerKillProcess.Start();
}
else
{
timerKillProcess.Stop();
}
}
private void ToggleSwitchSaveScreenshotsInDateFolders_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Automation.IsSaveScreenshotsInDateFolders = ToggleSwitchSaveScreenshotsInDateFolders.IsOn;

View File

@ -9,75 +9,122 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using File = System.IO.File;
namespace Ink_Canvas {
public partial class MainWindow : Window {
private void LoadSettings(bool isStartup = false) {
namespace Ink_Canvas
{
public partial class MainWindow : Window
{
private void LoadSettings(bool isStartup = false)
{
AppVersionTextBlock.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
try {
if (File.Exists(App.RootPath + settingsFileName)) {
try {
try
{
if (File.Exists(App.RootPath + settingsFileName))
{
try
{
string text = File.ReadAllText(App.RootPath + settingsFileName);
Settings = JsonConvert.DeserializeObject<Settings>(text);
} catch { }
} else {
}
catch
{
}
}
else
{
BtnResetToSuggestion_Click(null, null);
}
} catch (Exception ex) {
}
catch (Exception ex)
{
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
}
// Startup
if (isStartup) {
if (isStartup)
{
CursorIcon_Click(null, null);
}
try {
if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\Ink Canvas Annotation.lnk")) {
try
{
if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) +
"\\Ink Canvas Annotation.lnk"))
{
ToggleSwitchRunAtStartup.IsOn = true;
}
} catch (Exception ex) {
}
catch (Exception ex)
{
LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error);
}
if (Settings.Startup != null) {
if (isStartup) {
if (Settings.Automation.AutoDelSavedFiles) {
DelAutoSavedFiles.DeleteFilesOlder(Settings.Automation.AutoSavedStrokesLocation, Settings.Automation.AutoDelSavedFilesDaysThreshold);
if (Settings.Startup != null)
{
if (isStartup)
{
if (Settings.Automation.AutoDelSavedFiles)
{
DelAutoSavedFiles.DeleteFilesOlder(Settings.Automation.AutoSavedStrokesLocation,
Settings.Automation.AutoDelSavedFilesDaysThreshold);
}
if (Settings.Startup.IsFoldAtStartup) {
if (Settings.Startup.IsFoldAtStartup)
{
FoldFloatingBar_MouseUp(Fold_Icon, null);
}
}
if (Settings.Startup.IsEnableNibMode) {
if (Settings.Startup.IsEnableNibMode)
{
ToggleSwitchEnableNibMode.IsOn = true;
ToggleSwitchBoardEnableNibMode.IsOn = true;
BoundsWidth = Settings.Advanced.NibModeBoundsWidth;
} else {
}
else
{
ToggleSwitchEnableNibMode.IsOn = false;
ToggleSwitchBoardEnableNibMode.IsOn = false;
BoundsWidth = Settings.Advanced.FingerModeBoundsWidth;
}
if (Settings.Startup.IsAutoUpdate) {
if (Settings.Startup.IsAutoUpdate)
{
ToggleSwitchIsAutoUpdate.IsOn = true;
AutoUpdate();
}
// ToggleSwitchIsAutoUpdateWithSilence.Visibility = Settings.Startup.IsAutoUpdate ? Visibility.Visible : Visibility.Collapsed;
if (Settings.Startup.IsAutoUpdateWithSilence) {
if (Settings.Startup.IsAutoUpdateWithSilence)
{
ToggleSwitchIsAutoUpdateWithSilence.IsOn = true;
}
AutoUpdateTimePeriodBlock.Visibility = Settings.Startup.IsAutoUpdateWithSilence ? Visibility.Visible : Visibility.Collapsed;
AutoUpdateWithSilenceTimeComboBox.InitializeAutoUpdateWithSilenceTimeComboBoxOptions(AutoUpdateWithSilenceStartTimeComboBox, AutoUpdateWithSilenceEndTimeComboBox);
AutoUpdateTimePeriodBlock.Visibility = Settings.Startup.IsAutoUpdateWithSilence
? Visibility.Visible
: Visibility.Collapsed;
AutoUpdateWithSilenceTimeComboBox.InitializeAutoUpdateWithSilenceTimeComboBoxOptions(
AutoUpdateWithSilenceStartTimeComboBox, AutoUpdateWithSilenceEndTimeComboBox);
AutoUpdateWithSilenceStartTimeComboBox.SelectedItem = Settings.Startup.AutoUpdateWithSilenceStartTime;
AutoUpdateWithSilenceEndTimeComboBox.SelectedItem = Settings.Startup.AutoUpdateWithSilenceEndTime;
ToggleSwitchFoldAtStartup.IsOn = Settings.Startup.IsFoldAtStartup;
} else {
}
else
{
Settings.Startup = new Startup();
}
// Appearance
if (Settings.Appearance != null) {
if (!Settings.Appearance.IsEnableDisPlayNibModeToggler) {
if (Settings.Appearance != null)
{
if (!Settings.Appearance.IsEnableDisPlayNibModeToggler)
{
NibModeSimpleStackPanel.Visibility = Visibility.Collapsed;
BoardNibModeSimpleStackPanel.Visibility = Visibility.Collapsed;
} else {
}
else
{
NibModeSimpleStackPanel.Visibility = Visibility.Visible;
BoardNibModeSimpleStackPanel.Visibility = Visibility.Visible;
}
@ -107,29 +154,36 @@ namespace Ink_Canvas {
if (Settings.Appearance.ViewboxFloatingBarScaleTransformValue != 0) // 浮动工具栏 UI 缩放 85%
{
double val = Settings.Appearance.ViewboxFloatingBarScaleTransformValue;
ViewboxFloatingBarScaleTransform.ScaleX = (val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransform.ScaleY = (val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransform.ScaleX =
(val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransform.ScaleY =
(val > 0.5 && val < 1.25) ? val : val <= 0.5 ? 0.5 : val >= 1.25 ? 1.25 : 1;
ViewboxFloatingBarScaleTransformValueSlider.Value = val;
}
ComboBoxUnFoldBtnImg.SelectedIndex = Settings.Appearance.UnFoldButtonImageType;
if (Settings.Appearance.UnFoldButtonImageType==0)
if (Settings.Appearance.UnFoldButtonImageType == 0)
{
RightUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
RightUnFoldBtnImgChevron.Source =
new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
RightUnFoldBtnImgChevron.Width = 14;
RightUnFoldBtnImgChevron.Height = 14;
RightUnFoldBtnImgChevron.RenderTransform = new RotateTransform(180);
LeftUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
LeftUnFoldBtnImgChevron.Source =
new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/unfold-chevron.png"));
LeftUnFoldBtnImgChevron.Width = 14;
LeftUnFoldBtnImgChevron.Height = 14;
LeftUnFoldBtnImgChevron.RenderTransform = null;
} else if (Settings.Appearance.UnFoldButtonImageType ==1)
}
else if (Settings.Appearance.UnFoldButtonImageType == 1)
{
RightUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
RightUnFoldBtnImgChevron.Source =
new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
RightUnFoldBtnImgChevron.Width = 18;
RightUnFoldBtnImgChevron.Height = 18;
RightUnFoldBtnImgChevron.RenderTransform = null;
LeftUnFoldBtnImgChevron.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
LeftUnFoldBtnImgChevron.Source =
new BitmapImage(new Uri("pack://application:,,,/Resources/new-icons/pen-white.png"));
LeftUnFoldBtnImgChevron.Width = 18;
LeftUnFoldBtnImgChevron.Height = 18;
LeftUnFoldBtnImgChevron.RenderTransform = null;
@ -138,10 +192,12 @@ namespace Ink_Canvas {
if (Settings.Appearance.IsShowQuickPanel)
{
ToggleSwitchEnableQuickPanel.IsOn = true;
} else
}
else
{
ToggleSwitchEnableQuickPanel.IsOn = false;
}
if (Settings.Appearance.EnableViewboxBlackBoardScaleTransform) // 画板 UI 缩放 80%
{
ViewboxBlackboardLeftSideScaleTransform.ScaleX = 0.8;
@ -152,7 +208,9 @@ namespace Ink_Canvas {
ViewboxBlackboardRightSideScaleTransform.ScaleY = 0.8;
ToggleSwitchEnableViewboxBlackBoardScaleTransform.IsOn = true;
} else {
}
else
{
ViewboxBlackboardLeftSideScaleTransform.ScaleX = 1;
ViewboxBlackboardLeftSideScaleTransform.ScaleY = 1;
ViewboxBlackboardCenterSideScaleTransform.ScaleX = 1;
@ -162,73 +220,114 @@ namespace Ink_Canvas {
ToggleSwitchEnableViewboxBlackBoardScaleTransform.IsOn = false;
}
if (Settings.Appearance.IsTransparentButtonBackground) {
if (Settings.Appearance.IsTransparentButtonBackground)
{
BtnExit.Background = new SolidColorBrush(StringToColor("#7F909090"));
} else {
if (BtnSwitchTheme.Content.ToString() == "深色") {
}
else
{
if (BtnSwitchTheme.Content.ToString() == "深色")
{
//Light
BtnExit.Background = new SolidColorBrush(StringToColor("#FFCCCCCC"));
} else {
}
else
{
//Dark
BtnExit.Background = new SolidColorBrush(StringToColor("#FF555555"));
}
}
if (Settings.Appearance.EnableTimeDisplayInWhiteboardMode==true)
if (Settings.Appearance.EnableTimeDisplayInWhiteboardMode == true)
{
ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn = true;
} else
}
else
{
ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn = false;
}
SystemEvents_UserPreferenceChanged(null, null);
} else {
}
else
{
Settings.Appearance = new Appearance();
}
// PowerPointSettings
if (Settings.PowerPointSettings != null) {
PptNavigationBtn.Visibility = Settings.PowerPointSettings.IsShowPPTNavigation ? Visibility.Visible : Visibility.Collapsed;
if (Settings.PowerPointSettings != null)
{
PptNavigationBtn.Visibility = Settings.PowerPointSettings.IsShowPPTNavigation
? Visibility.Visible
: Visibility.Collapsed;
ToggleSwitchShowButtonPPTNavigation.IsOn = Settings.PowerPointSettings.IsShowPPTNavigation;
ToggleSwitchShowBottomPPTNavigationPanel.IsOn = Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel;
ToggleSwitchShowBottomPPTNavigationPanel.IsOn =
Settings.PowerPointSettings.IsShowBottomPPTNavigationPanel;
ToggleSwitchShowSidePPTNavigationPanel.IsOn = Settings.PowerPointSettings.IsShowSidePPTNavigationPanel;
if (Settings.PowerPointSettings.PowerPointSupport) {
if (Settings.PowerPointSettings.PowerPointSupport)
{
ToggleSwitchSupportPowerPoint.IsOn = true;
timerCheckPPT.Start();
} else {
}
else
{
ToggleSwitchSupportPowerPoint.IsOn = false;
timerCheckPPT.Stop();
}
if (Settings.PowerPointSettings.IsShowCanvasAtNewSlideShow) {
if (Settings.PowerPointSettings.IsShowCanvasAtNewSlideShow)
{
ToggleSwitchShowCanvasAtNewSlideShow.IsOn = true;
} else {
}
else
{
ToggleSwitchShowCanvasAtNewSlideShow.IsOn = false;
}
if (Settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode) {
if (Settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode)
{
ToggleSwitchEnableTwoFingerGestureInPresentationMode.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableTwoFingerGestureInPresentationMode.IsOn = false;
}
if (Settings.PowerPointSettings.IsEnableFingerGestureSlideShowControl) {
if (Settings.PowerPointSettings.IsEnableFingerGestureSlideShowControl)
{
ToggleSwitchEnableFingerGestureSlideShowControl.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableFingerGestureSlideShowControl.IsOn = false;
}
if (Settings.PowerPointSettings.IsAutoSaveStrokesInPowerPoint) {
if (Settings.PowerPointSettings.IsAutoSaveStrokesInPowerPoint)
{
ToggleSwitchAutoSaveStrokesInPowerPoint.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoSaveStrokesInPowerPoint.IsOn = false;
}
if (Settings.PowerPointSettings.IsNotifyPreviousPage) {
if (Settings.PowerPointSettings.IsNotifyPreviousPage)
{
ToggleSwitchNotifyPreviousPage.IsOn = true;
} else {
}
else
{
ToggleSwitchNotifyPreviousPage.IsOn = false;
}
if (Settings.PowerPointSettings.IsNotifyHiddenPage) {
if (Settings.PowerPointSettings.IsNotifyHiddenPage)
{
ToggleSwitchNotifyHiddenPage.IsOn = true;
} else {
}
else
{
ToggleSwitchNotifyHiddenPage.IsOn = false;
}
@ -240,81 +339,130 @@ namespace Ink_Canvas {
{
ToggleSwitchNotifyAutoPlayPresentation.IsOn = false;
}
if (Settings.PowerPointSettings.IsSupportWPS) {
if (Settings.PowerPointSettings.IsSupportWPS)
{
ToggleSwitchSupportWPS.IsOn = true;
} else {
}
else
{
ToggleSwitchSupportWPS.IsOn = false;
}
if (Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint) {
if (Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint)
{
ToggleSwitchAutoSaveScreenShotInPowerPoint.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoSaveScreenShotInPowerPoint.IsOn = false;
}
} else {
}
else
{
Settings.PowerPointSettings = new PowerPointSettings();
}
// Gesture
if (Settings.Gesture != null) {
if (Settings.Gesture.IsEnableMultiTouchMode) {
if (Settings.Gesture != null)
{
if (Settings.Gesture.IsEnableMultiTouchMode)
{
ToggleSwitchEnableMultiTouchMode.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableMultiTouchMode.IsOn = false;
}
if (Settings.Gesture.IsEnableTwoFingerZoom) {
if (Settings.Gesture.IsEnableTwoFingerZoom)
{
ToggleSwitchEnableTwoFingerZoom.IsOn = true;
BoardToggleSwitchEnableTwoFingerZoom.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableTwoFingerZoom.IsOn = false;
BoardToggleSwitchEnableTwoFingerZoom.IsOn = false;
}
if (Settings.Gesture.IsEnableTwoFingerTranslate) {
if (Settings.Gesture.IsEnableTwoFingerTranslate)
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = true;
BoardToggleSwitchEnableTwoFingerTranslate.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = false;
BoardToggleSwitchEnableTwoFingerTranslate.IsOn = false;
}
if (Settings.Gesture.IsEnableTwoFingerRotation) {
if (Settings.Gesture.IsEnableTwoFingerRotation)
{
ToggleSwitchEnableTwoFingerRotation.IsOn = true;
BoardToggleSwitchEnableTwoFingerRotation.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableTwoFingerRotation.IsOn = false;
BoardToggleSwitchEnableTwoFingerRotation.IsOn = false;
}
if (Settings.Gesture.AutoSwitchTwoFingerGesture) {
if (Settings.Gesture.AutoSwitchTwoFingerGesture)
{
ToggleSwitchAutoSwitchTwoFingerGesture.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoSwitchTwoFingerGesture.IsOn = false;
}
if (Settings.Gesture.IsEnableTwoFingerRotation) {
if (Settings.Gesture.IsEnableTwoFingerRotation)
{
ToggleSwitchEnableTwoFingerRotation.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableTwoFingerRotation.IsOn = false;
}
if (Settings.Gesture.IsEnableTwoFingerRotationOnSelection) {
if (Settings.Gesture.IsEnableTwoFingerRotationOnSelection)
{
ToggleSwitchEnableTwoFingerRotationOnSelection.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableTwoFingerRotationOnSelection.IsOn = false;
}
if (Settings.Gesture.AutoSwitchTwoFingerGesture) {
if (Topmost) {
if (Settings.Gesture.AutoSwitchTwoFingerGesture)
{
if (Topmost)
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = false;
BoardToggleSwitchEnableTwoFingerTranslate.IsOn = false;
Settings.Gesture.IsEnableTwoFingerTranslate = false;
if (!isInMultiTouchMode) ToggleSwitchEnableMultiTouchMode.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableTwoFingerTranslate.IsOn = true;
BoardToggleSwitchEnableTwoFingerTranslate.IsOn = true;
Settings.Gesture.IsEnableTwoFingerTranslate = true;
if (isInMultiTouchMode) ToggleSwitchEnableMultiTouchMode.IsOn = false;
}
}
CheckEnableTwoFingerGestureBtnColorPrompt();
} else {
}
else
{
Settings.Gesture = new Gesture();
}
// Canvas
if (Settings.Canvas != null) {
if (Settings.Canvas != null)
{
drawingAttributes.Height = Settings.Canvas.InkWidth;
drawingAttributes.Width = Settings.Canvas.InkWidth;
@ -323,16 +471,22 @@ namespace Ink_Canvas {
ComboBoxHyperbolaAsymptoteOption.SelectedIndex = (int)Settings.Canvas.HyperbolaAsymptoteOption;
if (Settings.Canvas.UsingWhiteboard) {
if (Settings.Canvas.UsingWhiteboard)
{
GridBackgroundCover.Background = new SolidColorBrush(StringToColor("#FFF2F2F2"));
} else {
}
else
{
GridBackgroundCover.Background = new SolidColorBrush(StringToColor("#FF1F1F1F"));
}
if (Settings.Canvas.IsShowCursor) {
if (Settings.Canvas.IsShowCursor)
{
ToggleSwitchShowCursor.IsOn = true;
inkCanvas.ForceCursor = true;
} else {
}
else
{
ToggleSwitchShowCursor.IsOn = false;
inkCanvas.ForceCursor = false;
}
@ -343,14 +497,16 @@ namespace Ink_Canvas {
ComboBoxEraserSize.SelectedIndex = Settings.Canvas.EraserSize;
ComboBoxEraserSizeFloatingBar.SelectedIndex = Settings.Canvas.EraserSize;
if (Settings.Canvas.ClearCanvasAndClearTimeMachine==true) {
if (Settings.Canvas.ClearCanvasAndClearTimeMachine == true)
{
ToggleSwitchClearCanvasAndClearTimeMachine.IsOn = true;
} else
}
else
{
ToggleSwitchClearCanvasAndClearTimeMachine.IsOn = false;
}
if (Settings.Canvas.EraserShapeType==0)
if (Settings.Canvas.EraserShapeType == 0)
{
double k = 1;
switch (Settings.Canvas.EraserSize)
@ -368,10 +524,11 @@ namespace Ink_Canvas {
k = 1.8;
break;
}
inkCanvas.EraserShape = new EllipseStylusShape(k * 90, k * 90);
inkCanvas.EditingMode = InkCanvasEditingMode.None;
} else if (Settings.Canvas.EraserShapeType == 1)
}
else if (Settings.Canvas.EraserShapeType == 1)
{
double k = 1;
switch (Settings.Canvas.EraserSize)
@ -389,17 +546,22 @@ namespace Ink_Canvas {
k = 1.6;
break;
}
inkCanvas.EraserShape = new RectangleStylusShape(k * 90 * 0.6, k * 90);
inkCanvas.EditingMode = InkCanvasEditingMode.None;
}
CheckEraserTypeTab();
if (Settings.Canvas.HideStrokeWhenSelecting) {
if (Settings.Canvas.HideStrokeWhenSelecting)
{
ToggleSwitchHideStrokeWhenSelecting.IsOn = true;
} else {
}
else
{
ToggleSwitchHideStrokeWhenSelecting.IsOn = false;
}
if (Settings.Canvas.FitToCurve)
{
ToggleSwitchFitToCurve.IsOn = true;
@ -410,48 +572,76 @@ namespace Ink_Canvas {
ToggleSwitchFitToCurve.IsOn = false;
drawingAttributes.FitToCurve = false;
}
} else {
}
else
{
Settings.Canvas = new Canvas();
}
// Advanced
if (Settings.Advanced != null) {
if (Settings.Advanced != null)
{
TouchMultiplierSlider.Value = Settings.Advanced.TouchMultiplier;
FingerModeBoundsWidthSlider.Value = Settings.Advanced.FingerModeBoundsWidth;
NibModeBoundsWidthSlider.Value = Settings.Advanced.NibModeBoundsWidth;
if (Settings.Advanced.IsLogEnabled) {
if (Settings.Advanced.IsLogEnabled)
{
ToggleSwitchIsLogEnabled.IsOn = true;
} else {
}
else
{
ToggleSwitchIsLogEnabled.IsOn = false;
}
if (Settings.Advanced.IsSecondConfimeWhenShutdownApp) {
if (Settings.Advanced.IsSecondConfimeWhenShutdownApp)
{
ToggleSwitchIsSecondConfimeWhenShutdownApp.IsOn = true;
} else {
}
else
{
ToggleSwitchIsSecondConfimeWhenShutdownApp.IsOn = false;
}
if (Settings.Advanced.EraserBindTouchMultiplier) {
if (Settings.Advanced.EraserBindTouchMultiplier)
{
ToggleSwitchEraserBindTouchMultiplier.IsOn = true;
} else {
}
else
{
ToggleSwitchEraserBindTouchMultiplier.IsOn = false;
}
if (Settings.Advanced.IsSpecialScreen) {
if (Settings.Advanced.IsSpecialScreen)
{
ToggleSwitchIsSpecialScreen.IsOn = true;
} else {
}
else
{
ToggleSwitchIsSpecialScreen.IsOn = false;
}
TouchMultiplierSlider.Visibility = ToggleSwitchIsSpecialScreen.IsOn ? Visibility.Visible : Visibility.Collapsed;
TouchMultiplierSlider.Visibility =
ToggleSwitchIsSpecialScreen.IsOn ? Visibility.Visible : Visibility.Collapsed;
ToggleSwitchIsQuadIR.IsOn = Settings.Advanced.IsQuadIR;
} else {
}
else
{
Settings.Advanced = new Advanced();
}
// InkToShape
if (Settings.InkToShape != null) {
if (Settings.InkToShape.IsInkToShapeEnabled) {
if (Settings.InkToShape != null)
{
if (Settings.InkToShape.IsInkToShapeEnabled)
{
ToggleSwitchEnableInkToShape.IsOn = true;
} else {
}
else
{
ToggleSwitchEnableInkToShape.IsOn = false;
}
if (Settings.InkToShape.IsInkToShapeNoFakePressureRectangle)
{
ToggleSwitchEnableInkToShapeNoFakePressureRectangle.IsOn = true;
@ -460,6 +650,7 @@ namespace Ink_Canvas {
{
ToggleSwitchEnableInkToShapeNoFakePressureRectangle.IsOn = false;
}
if (Settings.InkToShape.IsInkToShapeNoFakePressureTriangle)
{
ToggleSwitchEnableInkToShapeNoFakePressureTriangle.IsOn = true;
@ -468,13 +659,16 @@ namespace Ink_Canvas {
{
ToggleSwitchEnableInkToShapeNoFakePressureTriangle.IsOn = false;
}
if (Settings.InkToShape.IsInkToShapeTriangle)
{
ToggleCheckboxEnableInkToShapeTriangle.IsChecked = true;
} else
{
ToggleCheckboxEnableInkToShapeTriangle.IsChecked= false;
}
else
{
ToggleCheckboxEnableInkToShapeTriangle.IsChecked = false;
}
if (Settings.InkToShape.IsInkToShapeRectangle)
{
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = true;
@ -483,6 +677,7 @@ namespace Ink_Canvas {
{
ToggleCheckboxEnableInkToShapeRectangle.IsChecked = false;
}
if (Settings.InkToShape.IsInkToShapeRounded)
{
ToggleCheckboxEnableInkToShapeRounded.IsChecked = true;
@ -491,32 +686,52 @@ namespace Ink_Canvas {
{
ToggleCheckboxEnableInkToShapeRounded.IsChecked = false;
}
} else {
}
else
{
Settings.InkToShape = new InkToShape();
}
// RandSettings
if (Settings.RandSettings != null) {
} else {
if (Settings.RandSettings != null)
{
}
else
{
Settings.RandSettings = new RandSettings();
}
// Automation
if (Settings.Automation != null) {
if (Settings.Automation != null)
{
StartOrStoptimerCheckAutoFold();
if (Settings.Automation.IsAutoFoldInEasiNote) {
if (Settings.Automation.IsAutoFoldInEasiNote)
{
ToggleSwitchAutoFoldInEasiNote.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInEasiNote.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInEasiCamera) {
if (Settings.Automation.IsAutoFoldInEasiCamera)
{
ToggleSwitchAutoFoldInEasiCamera.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInEasiCamera.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInEasiNote3C) {
if (Settings.Automation.IsAutoFoldInEasiNote3C)
{
ToggleSwitchAutoFoldInEasiNote3C.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInEasiNote3C.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInEasiNote5C)
{
ToggleSwitchAutoFoldInEasiNote5C.IsOn = true;
@ -525,84 +740,161 @@ namespace Ink_Canvas {
{
ToggleSwitchAutoFoldInEasiNote5C.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInSeewoPincoTeacher) {
if (Settings.Automation.IsAutoFoldInSeewoPincoTeacher)
{
ToggleSwitchAutoFoldInSeewoPincoTeacher.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInSeewoPincoTeacher.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInHiteTouchPro) {
if (Settings.Automation.IsAutoFoldInHiteTouchPro)
{
ToggleSwitchAutoFoldInHiteTouchPro.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInHiteTouchPro.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInHiteCamera) {
if (Settings.Automation.IsAutoFoldInHiteLightBoard)
{
ToggleSwitchAutoFoldInHiteLightBoard.IsOn = true;
}
else
{
ToggleSwitchAutoFoldInHiteLightBoard.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInHiteCamera)
{
ToggleSwitchAutoFoldInHiteCamera.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInHiteCamera.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInWxBoardMain) {
if (Settings.Automation.IsAutoFoldInWxBoardMain)
{
ToggleSwitchAutoFoldInWxBoardMain.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInWxBoardMain.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInOldZyBoard) {
if (Settings.Automation.IsAutoFoldInOldZyBoard)
{
ToggleSwitchAutoFoldInOldZyBoard.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInOldZyBoard.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInMSWhiteboard) {
if (Settings.Automation.IsAutoFoldInMSWhiteboard)
{
ToggleSwitchAutoFoldInMSWhiteboard.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInMSWhiteboard.IsOn = false;
}
if (Settings.Automation.IsAutoFoldInPPTSlideShow) {
if (Settings.Automation.IsAutoFoldInPPTSlideShow)
{
ToggleSwitchAutoFoldInPPTSlideShow.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoFoldInPPTSlideShow.IsOn = false;
}
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService) {
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService)
{
timerKillProcess.Start();
} else {
}
else
{
timerKillProcess.Stop();
}
if (Settings.Automation.IsAutoKillEasiNote) {
if (Settings.Automation.IsAutoKillEasiNote)
{
ToggleSwitchAutoKillEasiNote.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoKillEasiNote.IsOn = false;
}
if (Settings.Automation.IsAutoKillPptService) {
if (Settings.Automation.IsAutoKillHiteAnnotation)
{
ToggleSwitchAutoKillHiteAnnotation.IsOn = true;
}
else
{
ToggleSwitchAutoKillHiteAnnotation.IsOn = false;
}
if (Settings.Automation.IsAutoKillPptService)
{
ToggleSwitchAutoKillPptService.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoKillPptService.IsOn = false;
}
if (Settings.Automation.IsAutoSaveStrokesAtClear) {
if (Settings.Automation.IsAutoSaveStrokesAtClear)
{
ToggleSwitchAutoSaveStrokesAtClear.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoSaveStrokesAtClear.IsOn = false;
}
if (Settings.Automation.IsSaveScreenshotsInDateFolders) {
if (Settings.Automation.IsSaveScreenshotsInDateFolders)
{
ToggleSwitchSaveScreenshotsInDateFolders.IsOn = true;
} else {
}
else
{
ToggleSwitchSaveScreenshotsInDateFolders.IsOn = false;
}
if (Settings.Automation.IsAutoSaveStrokesAtScreenshot) {
if (Settings.Automation.IsAutoSaveStrokesAtScreenshot)
{
ToggleSwitchAutoSaveStrokesAtScreenshot.IsOn = true;
} else {
}
else
{
ToggleSwitchAutoSaveStrokesAtScreenshot.IsOn = false;
}
SideControlMinimumAutomationSlider.Value = Settings.Automation.MinimumAutomationStrokeNumber;
AutoSavedStrokesLocation.Text = Settings.Automation.AutoSavedStrokesLocation;
ToggleSwitchAutoDelSavedFiles.IsOn = Settings.Automation.AutoDelSavedFiles;
ComboBoxAutoDelSavedFilesDaysThreshold.Text = Settings.Automation.AutoDelSavedFilesDaysThreshold.ToString();
} else {
ComboBoxAutoDelSavedFilesDaysThreshold.Text =
Settings.Automation.AutoDelSavedFilesDaysThreshold.ToString();
}
else
{
Settings.Automation = new Automation();
}
// auto align
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible) {
if (BtnPPTSlideShowEnd.Visibility == Visibility.Visible)
{
ViewboxFloatingBarMarginAnimation(60);
} else {
}
else
{
ViewboxFloatingBarMarginAnimation(100, true);
}
}

View File

@ -16,7 +16,6 @@ namespace Ink_Canvas
StrokeCollection newStrokes = new StrokeCollection();
List<Circle> circles = new List<Circle>();
//此函数中的所有代码版权所有 WXRIW在其他项目中使用前必须提前联系wxriw@outlook.com谢谢
private void inkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e)
{
if (Settings.Canvas.FitToCurve == true)
@ -318,7 +317,8 @@ namespace Ink_Canvas
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") ||
result.InkDrawingNode.GetShapeName().Contains("Trapezoid")) &&
Settings.InkToShape.IsInkToShapeRectangle == true)
{
var shape = result.InkDrawingNode.GetShape();

View File

@ -122,6 +122,14 @@ namespace Ink_Canvas
arg += " /IM EasiNote.exe";
}
}
if (Settings.Automation.IsAutoKillHiteAnnotation)
{
Process[] processes = Process.GetProcessesByName("HiteAnnotation");
if (processes.Length > 0)
{
arg += " /IM HiteAnnotation.exe";
}
}
if (arg != "/F")
{
Process p = new Process();
@ -134,6 +142,11 @@ namespace Ink_Canvas
BtnSwitch_Click(BtnSwitch, null);
MessageBox.Show("“希沃白板 5”已自动关闭");
}
if (arg.Contains("HiteAnnotation"))
{
BtnSwitch_Click(BtnSwitch, null);
MessageBox.Show("“鸿合屏幕书写”已自动关闭");
}
}
}
catch { }

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>dist\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
</Project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@ -209,6 +209,8 @@ namespace Ink_Canvas
[JsonProperty("isAutoFoldInHiteTouchPro")]
public bool IsAutoFoldInHiteTouchPro { get; set; } = false;
[JsonProperty("isAutoFoldInHiteLightBoard")]
public bool IsAutoFoldInHiteLightBoard { get; set; } = false;
[JsonProperty("isAutoFoldInHiteCamera")]
public bool IsAutoFoldInHiteCamera { get; set; } = false;
@ -233,6 +235,8 @@ namespace Ink_Canvas
[JsonProperty("isAutoKillEasiNote")]
public bool IsAutoKillEasiNote { get; set; } = false;
[JsonProperty("isAutoKillHiteAnnotation")]
public bool IsAutoKillHiteAnnotation { get; set; } = false;
[JsonProperty("isSaveScreenshotsInDateFolders")]
public bool IsSaveScreenshotsInDateFolders { get; set; } = false;