diff --git a/Ink Canvas/ChangeLogWindow.xaml b/Ink Canvas/ChangeLogWindow.xaml index 0519b91..2a2f2bf 100644 --- a/Ink Canvas/ChangeLogWindow.xaml +++ b/Ink Canvas/ChangeLogWindow.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:Ink_Canvas" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" ShowInTaskbar="False" xmlns:ui="http://schemas.modernwpf.com/2019" FontFamily="Microsoft YaHei UI" Topmost="True" mc:Ignorable="d" ui:WindowHelper.UseModernWindowStyle="True" Loaded="Window_Loaded" Closed="Window_Closed" - Title="" Height="400" Width="600"> + Title="" Height="430" Width="600"> @@ -38,7 +38,7 @@ - + diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index b32bf64..bfd0e6b 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:Ink_Canvas" xmlns:ui="http://schemas.modernwpf.com/2019" AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize" mc:Ignorable="d" WindowState="Maximized" Loaded="Window_Loaded" Background="Transparent" ShowInTaskbar="False" - Title="Ink Canvas 画板" Height="1000" Width="1000" FontFamily="Microsoft YaHei UI" + Title="Ink Canvas 画板" Height="10000" Width="1000" FontFamily="Microsoft YaHei UI" Foreground="Black" Stylus.IsPressAndHoldEnabled="False"> @@ -267,6 +267,8 @@ + + diff --git a/Ink Canvas/MainWindow.xaml.cs b/Ink Canvas/MainWindow.xaml.cs index 483bd09..c7700c2 100644 --- a/Ink Canvas/MainWindow.xaml.cs +++ b/Ink Canvas/MainWindow.xaml.cs @@ -164,29 +164,25 @@ namespace Ink_Canvas private void InkCanvas_Gesture(object sender, InkCanvasGestureEventArgs e) { ReadOnlyCollection gestures = e.GetGestureRecognitionResults(); - - foreach (GestureRecognitionResult gest in gestures) + try { - //Trace.WriteLine(string.Format("Gesture: {0}, Confidence: {1}", gest.ApplicationGesture, gest.RecognitionConfidence)); - if ((DateTime.Now - lastGestureTime).TotalMilliseconds <= 1500 && - StackPanelPPTControls.Visibility == Visibility.Visible && - lastApplicationGesture == gest.ApplicationGesture) + foreach (GestureRecognitionResult gest in gestures) { - if (gest.ApplicationGesture == ApplicationGesture.Left) + //Trace.WriteLine(string.Format("Gesture: {0}, Confidence: {1}", gest.ApplicationGesture, gest.RecognitionConfidence)); + if (StackPanelPPTControls.Visibility == Visibility.Visible) { - BtnPPTSlidesDown_Click(BtnPPTSlidesDown, null); - } - if (gest.ApplicationGesture == ApplicationGesture.Right) - { - BtnPPTSlidesDown_Click(BtnPPTSlidesDown, null); + if (gest.ApplicationGesture == ApplicationGesture.Left) + { + BtnPPTSlidesDown_Click(BtnPPTSlidesDown, null); + } + if (gest.ApplicationGesture == ApplicationGesture.Right) + { + BtnPPTSlidesUp_Click(BtnPPTSlidesUp, null); + } } } - - lastApplicationGesture = gest.ApplicationGesture; - lastGestureTime = DateTime.Now; } - - inkCanvas.Strokes.Add(e.Strokes); + catch { } } private void inkCanvas_EditingModeChanged(object sender, RoutedEventArgs e) { @@ -524,6 +520,14 @@ namespace Ink_Canvas { ToggleSwitchEnableTwoFingerGestureInPresentationMode.IsOn = false; } + if (Settings.Gesture.IsEnableFingerGestureSlideShowControl) + { + ToggleSwitchEnableFingerGestureSlideShowControl.IsOn = true; + } + else + { + ToggleSwitchEnableFingerGestureSlideShowControl.IsOn = false; + } if (File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) + "\\InkCanvas" + ".lnk")) { @@ -1358,6 +1362,7 @@ namespace Ink_Canvas BorderClearInDelete.Visibility = Visibility.Collapsed; iniP = e.GetTouchPoint(inkCanvas).Position; + inkCanvas.Opacity = 1; double boundsWidth = GetTouchBoundWidth(e); if (boundsWidth > BoundsWidth) @@ -1371,10 +1376,19 @@ namespace Ink_Canvas } else { - inkCanvas.EraserShape = new EllipseStylusShape(5, 5); - //inkCanvas.EraserShape = new RectangleStylusShape(8, 8); - //inkCanvas.EraserShape = new EllipseStylusShape(boundsWidth * 1.5, boundsWidth * 1.5); - inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke; + if (StackPanelPPTControls.Visibility == Visibility.Visible && inkCanvas.Strokes.Count == 0 && Settings.Gesture.IsEnableFingerGestureSlideShowControl) + { + isLastTouchEraser = false; + inkCanvas.EditingMode = InkCanvasEditingMode.GestureOnly; + inkCanvas.Opacity = 0.1; + } + else + { + inkCanvas.EraserShape = new EllipseStylusShape(5, 5); + //inkCanvas.EraserShape = new RectangleStylusShape(8, 8); + //inkCanvas.EraserShape = new EllipseStylusShape(boundsWidth * 1.5, boundsWidth * 1.5); + inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke; + } } } else @@ -2267,6 +2281,16 @@ namespace Ink_Canvas #region Gesture + + private void ToggleSwitchEnableFingerGestureSlideShowControl_Toggled(object sender, RoutedEventArgs e) + { + if (!isLoaded) return; + + Settings.Gesture.IsEnableFingerGestureSlideShowControl = ToggleSwitchEnableFingerGestureSlideShowControl.IsOn; + + SaveSettingsToFile(); + } + private void ToggleSwitchEnableTwoFingerRotation_Toggled(object sender, RoutedEventArgs e) { if (!isLoaded) return; @@ -3055,6 +3079,7 @@ namespace Ink_Canvas { try { + inkCanvas.Opacity = 1; if (Settings.InkToShape.IsInkToShapeEnabled) { try diff --git a/Ink Canvas/Properties/AssemblyInfo.cs b/Ink Canvas/Properties/AssemblyInfo.cs index 5fd0126..004916e 100644 --- a/Ink Canvas/Properties/AssemblyInfo.cs +++ b/Ink Canvas/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ using System.Windows; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.0.1.0")] -[assembly: AssemblyFileVersion("3.0.1.0")] +[assembly: AssemblyVersion("3.0.2.0")] +[assembly: AssemblyFileVersion("3.0.2.0")] diff --git a/Ink Canvas/Settings.cs b/Ink Canvas/Settings.cs index 49eca2b..442e282 100644 --- a/Ink Canvas/Settings.cs +++ b/Ink Canvas/Settings.cs @@ -51,6 +51,8 @@ namespace Ink_Canvas public bool IsEnableTwoFingerRotation { get; set; } = false; [JsonProperty("isEnableTwoFingerGestureInPresentationMode")] public bool IsEnableTwoFingerGestureInPresentationMode { get; set; } = false; + [JsonProperty("isEnableFingerGestureSlideShowControl")] + public bool IsEnableFingerGestureSlideShowControl { get; set; } = true; } public class Startup