diff --git a/Ink Canvas/AssemblyInfo.cs b/Ink Canvas/AssemblyInfo.cs new file mode 100644 index 0000000..0a156b5 --- /dev/null +++ b/Ink Canvas/AssemblyInfo.cs @@ -0,0 +1,53 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("InkCanvasForClass")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Dubi906w")] +[assembly: AssemblyProduct("InkCanvasForClass")] +[assembly: AssemblyCopyright("Copyright © HARKOTEK Studio 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// 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("5.0.2.0")] +[assembly: AssemblyFileVersion("5.0.2.0")] diff --git a/Ink Canvas/Helpers/TimeMachine.cs b/Ink Canvas/Helpers/TimeMachine.cs index 3031c1f..4855ff1 100644 --- a/Ink Canvas/Helpers/TimeMachine.cs +++ b/Ink Canvas/Helpers/TimeMachine.cs @@ -42,14 +42,14 @@ namespace Ink_Canvas.Helpers NotifyUndoRedoState(); } - public void CommitStrokeRotateHistory(StrokeCollection strokeToBeReplaced, StrokeCollection generatedStroke) + public void CommitStrokeManipulationHistory(StrokeCollection strokeToBeReplaced, StrokeCollection generatedStroke) { if (_currentIndex + 1 < _currentStrokeHistory.Count) { _currentStrokeHistory.RemoveRange(_currentIndex + 1, (_currentStrokeHistory.Count - 1) - _currentIndex); } _currentStrokeHistory.Add(new TimeMachineHistory(generatedStroke, - TimeMachineHistoryType.Rotate, + TimeMachineHistoryType.Manipulation, false, strokeToBeReplaced)); _currentIndex = _currentStrokeHistory.Count - 1; @@ -143,6 +143,6 @@ namespace Ink_Canvas.Helpers UserInput, ShapeRecognition, Clear, - Rotate + Manipulation } } \ No newline at end of file diff --git a/Ink Canvas/Ink Canvas.csproj b/Ink Canvas/Ink Canvas.csproj index 1ee7e6a..c0a0c2e 100644 --- a/Ink Canvas/Ink Canvas.csproj +++ b/Ink Canvas/Ink Canvas.csproj @@ -1,23 +1,12 @@ - - - + win;win-x86;win-x64;win-arm64 - Debug - AnyCPU - {8D0EDFC7-F974-4571-BC49-6F3A6653FE81} WinExe Ink_Canvas - Ink Canvas Annotation - v4.7.2 - 512 + InkCanvasForClass + net472 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 true - true - - - false publish\ true @@ -33,90 +22,65 @@ 2.0.2.%2a false false + false + true - AnyCPU - true full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 + bin\$(Configuration)\ - AnyCPU pdbonly - true - bin\Release\ - TRACE - prompt - 4 + bin\$(Configuration)\ - Resources\Ink Canvas Annotation.ico + icc.ico - true - bin\x86\Debug\ - DEBUG;TRACE + bin\$(Platform)\$(Configuration)\ full - x86 7.3 - prompt true - bin\x86\Release\ - TRACE - true + bin\$(Platform)\$(Configuration)\ pdbonly - x86 7.3 - prompt true app.manifest + InkCanvasForClass + 5.0.3 + Dubi906w + InkCanvasForClass + © Copyright HARKOTEK Studio 2024-now + https://icc.bliemhax.com + bundled + False - true - bin\ARM64\Debug\ - DEBUG;TRACE + bin\$(Platform)\$(Configuration)\ full - ARM64 7.3 - prompt true - bin\ARM64\Release\ - TRACE - true + bin\$(Platform)\$(Configuration)\ pdbonly - ARM64 7.3 - prompt true - true - bin\x64\Debug\ - DEBUG;TRACE + bin\$(Platform)\$(Configuration)\ full - x64 7.3 - prompt true - bin\x64\Release\ - TRACE - true + bin\$(Platform)\$(Configuration)\ pdbonly - x64 7.3 - prompt true @@ -131,19 +95,11 @@ - - - - - - - - 4.0 - + @@ -152,191 +108,16 @@ - - MSBuild:Compile - Designer - - - - - - - - - - - - - - - - - - - - - - - - - HasNewUpdateWindow.xaml - - - OperatingGuideWindow.xaml - - - CycleProcessBar.xaml - - - - - - - - - - - NamesInputWindow.xaml - - - RandWindow.xaml - - - YesOrNoNotificationWindow.xaml - - - - CountdownTimerWindow.xaml - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - - MainWindow.xaml - Code - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - ResXFileCodeGenerator - Resources.Designer.cs - - - SettingsSingleFileGenerator - Settings.Designer.cs - - + + + + - - - 0.9.26.3 - - - 1.27.0 - - - 15.0.4420.1018 - - - 15.0.0 - - - - - - - 13.0.3 - + @@ -367,21 +148,6 @@ True - - - - - - False - Microsoft .NET Framework 4.7.2 %28x86 和 x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - @@ -403,9 +169,6 @@ - - - @@ -636,5 +399,26 @@ - + + + + + + + + + + + + True + True + Settings.settings + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + \ No newline at end of file diff --git a/Ink Canvas/Ink Canvas.csproj.user b/Ink Canvas/Ink Canvas.csproj.user deleted file mode 100644 index cebb4cf..0000000 --- a/Ink Canvas/Ink Canvas.csproj.user +++ /dev/null @@ -1,14 +0,0 @@ - - - - ProjectFiles - publish\ - - - - - - zh-CN - false - - \ No newline at end of file diff --git a/Ink Canvas/MainWindow.xaml b/Ink Canvas/MainWindow.xaml index bcf8d35..c3d39ff 100644 --- a/Ink Canvas/MainWindow.xaml +++ b/Ink Canvas/MainWindow.xaml @@ -112,6 +112,7 @@ MouseMove="inkCanvas_MouseMove" MouseUp="inkCanvas_MouseUp" ManipulationStarting="inkCanvas_ManipulationStarting" + ManipulationStarted="inkCanvas_ManipulationStarted" SelectionChanged="inkCanvas_SelectionChanged" StrokeCollected="inkCanvas_StrokeCollected"/> diff --git a/Ink Canvas/MainWindow_cs/MW_BoardControls.cs b/Ink Canvas/MainWindow_cs/MW_BoardControls.cs index 558ab4e..336b56f 100644 --- a/Ink Canvas/MainWindow_cs/MW_BoardControls.cs +++ b/Ink Canvas/MainWindow_cs/MW_BoardControls.cs @@ -75,7 +75,7 @@ namespace Ink_Canvas { inkCanvas.Strokes.Remove(strokes); } } - } else if (item.CommitType == TimeMachineHistoryType.Rotate) { + } else if (item.CommitType == TimeMachineHistoryType.Manipulation) { if (item.StrokeHasBeenCleared) { foreach (var strokes in item.CurrentStroke) { @@ -162,7 +162,7 @@ namespace Ink_Canvas { inkCanvas.Strokes.Remove(strokes); } } - } else if (item.CommitType == TimeMachineHistoryType.Rotate) { + } else if (item.CommitType == TimeMachineHistoryType.Manipulation) { if (item.StrokeHasBeenCleared) { foreach (var strokes in item.CurrentStroke) { diff --git a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs index 20cc837..0fcdccd 100644 --- a/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs +++ b/Ink Canvas/MainWindow_cs/MW_FloatingBarIcons.cs @@ -974,7 +974,7 @@ namespace Ink_Canvas { inkCanvas.Strokes.Remove(strokes); } } - } else if (item.CommitType == TimeMachineHistoryType.Rotate) { + } else if (item.CommitType == TimeMachineHistoryType.Manipulation) { if (item.StrokeHasBeenCleared) { foreach (var strokes in item.CurrentStroke) { @@ -1066,7 +1066,7 @@ namespace Ink_Canvas { inkCanvas.Strokes.Remove(strokes); } } - } else if (item.CommitType == TimeMachineHistoryType.Rotate) { + } else if (item.CommitType == TimeMachineHistoryType.Manipulation) { if (item.StrokeHasBeenCleared) { foreach (var strokes in item.CurrentStroke) { diff --git a/Ink Canvas/MainWindow_cs/MW_PPT.cs b/Ink Canvas/MainWindow_cs/MW_PPT.cs index 39c25e1..2a4a7ac 100644 --- a/Ink Canvas/MainWindow_cs/MW_PPT.cs +++ b/Ink Canvas/MainWindow_cs/MW_PPT.cs @@ -1,6 +1,6 @@ using Ink_Canvas.Helpers; using Microsoft.Office.Interop.PowerPoint; -using iNKORE.UI.WPF.Modern; +using iNKORE.UI.WPF.Helpers; using System; using System.Diagnostics; using System.IO; @@ -16,7 +16,7 @@ using System.Windows.Threading; using Application = System.Windows.Application; using File = System.IO.File; using MessageBox = System.Windows.MessageBox; -using iNKORE.UI.WPF.Helpers; +using iNKORE.UI.WPF.Modern; namespace Ink_Canvas { public partial class MainWindow : Window { diff --git a/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs b/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs index 8a61ef9..8fde4e9 100644 --- a/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs +++ b/Ink Canvas/MainWindow_cs/MW_SelectionGestures.cs @@ -121,7 +121,7 @@ namespace Ink_Canvas { foreach (Stroke stroke in resultStrokes) { stroke.Transform(m, false); } - _currentCommitType = CommitReason.Rotate; + _currentCommitType = CommitReason.Manipulation; inkCanvas.Strokes.Replace(targetStrokes, resultStrokes); _currentCommitType = CommitReason.UserInput; isProgramChangeStrokeSelection = true; @@ -151,7 +151,7 @@ namespace Ink_Canvas { foreach (Stroke stroke in resultStrokes) { stroke.Transform(m, false); } - _currentCommitType = CommitReason.Rotate; + _currentCommitType = CommitReason.Manipulation; inkCanvas.Strokes.Replace(targetStrokes, resultStrokes); _currentCommitType = CommitReason.UserInput; isProgramChangeStrokeSelection = true; @@ -179,7 +179,7 @@ namespace Ink_Canvas { foreach (Stroke stroke in resultStrokes) { stroke.Transform(m, false); } - _currentCommitType = CommitReason.Rotate; + _currentCommitType = CommitReason.Manipulation; inkCanvas.Strokes.Replace(targetStrokes, resultStrokes); _currentCommitType = CommitReason.UserInput; isProgramChangeStrokeSelection = true; @@ -207,7 +207,7 @@ namespace Ink_Canvas { foreach (Stroke stroke in resultStrokes) { stroke.Transform(m, false); } - _currentCommitType = CommitReason.Rotate; + _currentCommitType = CommitReason.Manipulation; inkCanvas.Strokes.Replace(targetStrokes, resultStrokes); _currentCommitType = CommitReason.UserInput; isProgramChangeStrokeSelection = true; diff --git a/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs b/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs index ff18d72..195b6fe 100644 --- a/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs +++ b/Ink Canvas/MainWindow_cs/MW_SettingsToLoad.cs @@ -151,6 +151,7 @@ namespace Ink_Canvas { { ToggleSwitchEnableTimeDisplayInWhiteboardMode.IsOn = false; } + SystemEvents_UserPreferenceChanged(null, null); } else { Settings.Appearance = new Appearance(); } diff --git a/Ink Canvas/MainWindow_cs/MW_ShapeDrawing.cs b/Ink Canvas/MainWindow_cs/MW_ShapeDrawing.cs index 0f69e93..6a7bf62 100644 --- a/Ink Canvas/MainWindow_cs/MW_ShapeDrawing.cs +++ b/Ink Canvas/MainWindow_cs/MW_ShapeDrawing.cs @@ -1418,13 +1418,17 @@ namespace Ink_Canvas { } if (_currentCommitType == CommitReason.ShapeDrawing && drawingShapeMode != 9) { _currentCommitType = CommitReason.UserInput; - StrokeCollection collection; + StrokeCollection collection = null; if (lastTempStrokeCollection != null && lastTempStrokeCollection.Count > 0) { collection = lastTempStrokeCollection; - } else { + } else if (lastTempStroke != null) + { collection = new StrokeCollection() { lastTempStroke }; } - timeMachine.CommitStrokeUserInputHistory(collection); + if (collection != null) + { + timeMachine.CommitStrokeUserInputHistory(collection); + } } lastTempStroke = null; lastTempStrokeCollection = null; diff --git a/Ink Canvas/MainWindow_cs/MW_TimeMachine.cs b/Ink Canvas/MainWindow_cs/MW_TimeMachine.cs index ab3d80b..862ed63 100644 --- a/Ink Canvas/MainWindow_cs/MW_TimeMachine.cs +++ b/Ink Canvas/MainWindow_cs/MW_TimeMachine.cs @@ -11,7 +11,7 @@ namespace Ink_Canvas { ShapeDrawing, ShapeRecognition, ClearingCanvas, - Rotate + Manipulation } private CommitReason _currentCommitType = CommitReason.UserInput; @@ -40,8 +40,9 @@ namespace Ink_Canvas { } if (_currentCommitType == CommitReason.CodeInput || _currentCommitType == CommitReason.ShapeDrawing) return; - if (_currentCommitType == CommitReason.Rotate) { - timeMachine.CommitStrokeRotateHistory(e.Removed, e.Added); + if (_currentCommitType == CommitReason.Manipulation) + { + timeMachine.CommitStrokeManipulationHistory(e.Removed, e.Added); return; } if ((e.Added.Count != 0 || e.Removed.Count != 0) && IsEraseByPoint) { diff --git a/Ink Canvas/MainWindow_cs/MW_TouchEvents.cs b/Ink Canvas/MainWindow_cs/MW_TouchEvents.cs index ac11419..4bf754d 100644 --- a/Ink Canvas/MainWindow_cs/MW_TouchEvents.cs +++ b/Ink Canvas/MainWindow_cs/MW_TouchEvents.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Ink; @@ -66,9 +67,10 @@ namespace Ink_Canvas { TouchDownPointsList[e.StylusDevice.Id] = InkCanvasEditingMode.None; } - private void MainWindow_StylusUp(object sender, StylusEventArgs e) { + private async void MainWindow_StylusUp(object sender, StylusEventArgs e) { try { inkCanvas.Strokes.Add(GetStrokeVisual(e.StylusDevice.Id).Stroke); + await Task.Delay(5); // 避免渲染墨迹完成前预览墨迹被删除导致墨迹闪烁 inkCanvas.Children.Remove(GetVisualCanvas(e.StylusDevice.Id)); inkCanvas_StrokeCollected(inkCanvas, new InkCanvasStrokeCollectedEventArgs(GetStrokeVisual(e.StylusDevice.Id).Stroke)); @@ -273,6 +275,24 @@ namespace Ink_Canvas { } } + private void inkCanvas_ManipulationStarted(object sender, ManipulationStartedEventArgs e) + { + if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture || inkCanvas.Strokes.Count == 0 || dec.Count() < 2) return; + _currentCommitType = CommitReason.Manipulation; + StrokeCollection strokes = inkCanvas.GetSelectedStrokes(); + if (strokes.Count != 0) + { + inkCanvas.Strokes.Replace(strokes, strokes.Clone()); + } + else + { + var originalStrokes = inkCanvas.Strokes; + var targetStrokes = originalStrokes.Clone(); + originalStrokes.Replace(originalStrokes, targetStrokes); + } + _currentCommitType = CommitReason.UserInput; + } + private void Main_Grid_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) { if (isInMultiTouchMode || !Settings.Gesture.IsEnableTwoFingerGesture) return; if ((dec.Count >= 2 && (Settings.PowerPointSettings.IsEnableTwoFingerGestureInPresentationMode || StackPanelPPTControls.Visibility != Visibility.Visible || StackPanelPPTButtons.Visibility == Visibility.Collapsed)) || isSingleFingerDragMode) { diff --git a/Ink Canvas/Properties/AssemblyInfo.cs b/Ink Canvas/Properties/AssemblyInfo.cs index 5af6d78..da0d98e 100644 --- a/Ink Canvas/Properties/AssemblyInfo.cs +++ b/Ink Canvas/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ using System.Windows; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Ink Canvas for Class")] +[assembly: AssemblyTitle("InkCanvasForClass")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Dubi906w")] -[assembly: AssemblyProduct("Ink Canvas for Class")] -[assembly: AssemblyCopyright("Copyright © HARKOTEK Studio 2024")] +[assembly: AssemblyCompany("HARKOTEK Studio")] +[assembly: AssemblyProduct("InkCanvasForClass")] +[assembly: AssemblyCopyright("© Copyright HARKOTEK Studio 2024-now")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -49,5 +49,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("5.0.2.0")] -[assembly: AssemblyFileVersion("5.0.2.0")] +[assembly: AssemblyVersion("5.0.3.0")] +[assembly: AssemblyFileVersion("5.0.3.0")] \ No newline at end of file diff --git a/Ink Canvas/Properties/Settings.Designer.cs b/Ink Canvas/Properties/Settings.Designer.cs index 4ba88b6..9c56a3a 100644 --- a/Ink Canvas/Properties/Settings.Designer.cs +++ b/Ink Canvas/Properties/Settings.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ @@ -12,7 +12,7 @@ namespace Ink_Canvas.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Ink Canvas/Resources/Ink Canvas Annotation.ico b/Ink Canvas/Resources/Ink Canvas Annotation.ico deleted file mode 100644 index 72a67fe..0000000 Binary files a/Ink Canvas/Resources/Ink Canvas Annotation.ico and /dev/null differ diff --git a/Ink Canvas/Resources/Ink-Canvas-For-Annotation.png b/Ink Canvas/Resources/Ink-Canvas-For-Annotation.png deleted file mode 100644 index d11b5c6..0000000 Binary files a/Ink Canvas/Resources/Ink-Canvas-For-Annotation.png and /dev/null differ diff --git a/Ink Canvas/Resources/InkCanvas.png b/Ink Canvas/Resources/InkCanvas.png deleted file mode 100644 index 4ddcf4f..0000000 Binary files a/Ink Canvas/Resources/InkCanvas.png and /dev/null differ diff --git a/Ink Canvas/Resources/SeewoImageDictionary.xaml b/Ink Canvas/Resources/SeewoImageDictionary.xaml index bb85668..663bd52 100644 --- a/Ink Canvas/Resources/SeewoImageDictionary.xaml +++ b/Ink Canvas/Resources/SeewoImageDictionary.xaml @@ -1,4 +1,4 @@ - diff --git a/Ink Canvas/Resources/icc.ico b/Ink Canvas/Resources/icc.ico new file mode 100644 index 0000000..200daa4 Binary files /dev/null and b/Ink Canvas/Resources/icc.ico differ diff --git a/Ink Canvas/icc.ico b/Ink Canvas/icc.ico new file mode 100644 index 0000000..200daa4 Binary files /dev/null and b/Ink Canvas/icc.ico differ