diff --git a/InkCanvasForClass/App.xaml.cs b/InkCanvasForClass/App.xaml.cs index a9dc9c6..af2a2a8 100644 --- a/InkCanvasForClass/App.xaml.cs +++ b/InkCanvasForClass/App.xaml.cs @@ -1,13 +1,20 @@ using Hardcodet.Wpf.TaskbarNotification; using Ink_Canvas.Helpers; using iNKORE.UI.WPF.Modern.Controls; +using Newtonsoft.Json; using System; +using System.IO; using System.Linq; using System.Reflection; using System.Windows; +using iNKORE.UI.WPF.Helpers; +using Newtonsoft.Json.Linq; using static System.Windows.Forms.VisualStyles.VisualStyleElement; using MessageBox = System.Windows.MessageBox; using Window = System.Windows.Window; +using System.Windows.Shell; +using Ookii.Dialogs.Wpf; +using System.Diagnostics; namespace Ink_Canvas { @@ -39,7 +46,7 @@ namespace Ink_Canvas void App_Startup(object sender, StartupEventArgs e) { - /*if (!StoreHelper.IsStoreApp) */RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; + RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; LogHelper.NewLog(string.Format("Ink Canvas Starting (Version: {0})", Assembly.GetExecutingAssembly().GetName().Version.ToString())); @@ -49,19 +56,65 @@ namespace Ink_Canvas if (!ret && !e.Args.Contains("-m")) //-m multiple { LogHelper.NewLog("Detected existing instance"); - MessageBox.Show("已有一个程序实例正在运行"); + + if (TaskDialog.OSSupportsTaskDialogs) { + using (TaskDialog dialog = new TaskDialog()) + { + dialog.WindowTitle = "InkCanvasForClass"; + dialog.MainIcon = TaskDialogIcon.Warning; + dialog.MainInstruction = "已有一个实例正在运行"; + dialog.Content = "这意味着 InkCanvasForClass 正在运行,而您又运行了主程序一遍。如果频繁出现该弹窗且ICC无法正常启动时,请尝试 “以多开模式启动”。"; + TaskDialogButton customButton = new TaskDialogButton("以多开模式启动"); + customButton.Default = false; + dialog.ButtonClicked += (object s, TaskDialogItemClickedEventArgs _e) => { + if (_e.Item == customButton) + { + Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m"); + } + }; + TaskDialogButton okButton = new TaskDialogButton(ButtonType.Ok); + okButton.Default = true; + dialog.Buttons.Add(customButton); + dialog.Buttons.Add(okButton); + TaskDialogButton button = dialog.ShowDialog(); + } + } + LogHelper.NewLog("Ink Canvas automatically closed"); Environment.Exit(0); } - if (e.Args.Contains("--v6")) //-v6 进入ICCX(v6) - { - MessageBox.Show("检测到进入ICCX"); - } else { - mainWin = new MainWindow(); - mainWin.Show(); + + var isUsingWindowChrome = false; + try { + if (File.Exists(App.RootPath + "Settings.json")) { + try { + string text = File.ReadAllText(App.RootPath + "Settings.json"); + var obj = JObject.Parse(text); + isUsingWindowChrome = (bool)obj.SelectToken("startup.enableWindowChromeRendering"); + } + catch { } + } + } catch (Exception ex) { + LogHelper.WriteLogToFile(ex.ToString(), LogHelper.LogType.Error); } + mainWin = new MainWindow(); + + if (isUsingWindowChrome) { + mainWin.AllowsTransparency = false; + WindowChrome wc = new WindowChrome(); + wc.GlassFrameThickness = new Thickness(-1); + wc.CaptionHeight = 0; + wc.CornerRadius = new CornerRadius(0); + wc.ResizeBorderThickness = new Thickness(0); + WindowChrome.SetWindowChrome(mainWin, wc); + } else { + mainWin.AllowsTransparency = true; + WindowChrome.SetWindowChrome(mainWin, null); + } + mainWin.Show(); + _taskbar = (TaskbarIcon)FindResource("TaskbarTrayIcon"); StartArgs = e.Args; diff --git a/InkCanvasForClass/Helpers/ColorUtilities.cs b/InkCanvasForClass/Helpers/ColorUtilities.cs new file mode 100644 index 0000000..9049a43 --- /dev/null +++ b/InkCanvasForClass/Helpers/ColorUtilities.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; + +namespace Ink_Canvas.Helpers +{ + public class ColorUtilities { + + /// + /// 获取一个颜色的人眼感知亮度,并以 0~1 之间的小数表示。 + /// + public static double GetGrayLevel(Color color) { + return (0.299 * color.R + 0.587 * color.G + 0.114 * color.B) / 255; + } + + /// + /// 根据人眼感知亮度返回前景色到底是黑色还是白色 + /// + /// GetGrayLevel返回的人眼感知亮度 + /// Color + public static Color GetReverseForegroundColor(double grayLevel) => grayLevel > 0.5 ? Colors.Black : Colors.White; + } +} diff --git a/InkCanvasForClass/Helpers/Converters.cs b/InkCanvasForClass/Helpers/Converters.cs index 1d21995..09f4fc0 100644 --- a/InkCanvasForClass/Helpers/Converters.cs +++ b/InkCanvasForClass/Helpers/Converters.cs @@ -5,61 +5,6 @@ using System.Windows.Data; namespace Ink_Canvas.Converter { - public class BooleanToVisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if ((bool)value == true) - { - return Visibility.Visible; - } - else - { - return Visibility.Collapsed; - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - if ((bool)value == true) - { - return Visibility.Visible; - } - else - { - return Visibility.Collapsed; - } - } - } - public class VisibilityConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - Visibility visibility = (Visibility)value; - if (visibility == Visibility.Visible) - { - return Visibility.Collapsed; - } - else - { - return Visibility.Visible; - } - } - - public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - Visibility visibility = (Visibility)value; - if (visibility == Visibility.Visible) - { - return Visibility.Collapsed; - } - else - { - return Visibility.Visible; - } - } - } - public class IntNumberToString : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) diff --git a/InkCanvasForClass/Helpers/DrawingVisualCanvas.cs b/InkCanvasForClass/Helpers/DrawingVisualCanvas.cs new file mode 100644 index 0000000..57374ef --- /dev/null +++ b/InkCanvasForClass/Helpers/DrawingVisualCanvas.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Windows; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using Pen = System.Windows.Media.Pen; + +namespace Ink_Canvas.Helpers +{ + + public class DrawingVisualCanvas : FrameworkElement + { + private VisualCollection _children; + public DrawingVisual DrawingVisual = new DrawingVisual(); + + public DrawingVisualCanvas() + { + _children = new VisualCollection(this) { + DrawingVisual // 初始化DrawingVisual + }; + } + + protected override int VisualChildrenCount => _children.Count; + + protected override Visual GetVisualChild(int index) + { + if (index < 0 || index >= _children.Count) throw new ArgumentOutOfRangeException(); + return _children[index]; + } + } +} diff --git a/InkCanvasForClass/Helpers/DwmCompositionHelper.cs b/InkCanvasForClass/Helpers/DwmCompositionHelper.cs new file mode 100644 index 0000000..60d12e0 --- /dev/null +++ b/InkCanvasForClass/Helpers/DwmCompositionHelper.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Ink_Canvas.Helpers +{ + public class DwmCompositionHelper{ + public const string LibraryName = "Dwmapi.dll"; + + [DllImport(LibraryName, ExactSpelling = true, PreserveSig = false)] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool DwmIsCompositionEnabled(); + } +} diff --git a/InkCanvasForClass/Helpers/InkStrokesOverlay.cs b/InkCanvasForClass/Helpers/InkStrokesOverlay.cs new file mode 100644 index 0000000..01d591d --- /dev/null +++ b/InkCanvasForClass/Helpers/InkStrokesOverlay.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Runtime.Remoting.Contexts; +using System.Windows; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using Pen = System.Windows.Media.Pen; + +namespace Ink_Canvas.Helpers +{ + + public class InkStrokesOverlay : FrameworkElement + { + private VisualCollection _children; + private ImprovedDrawingVisual _layer = new ImprovedDrawingVisual(); + private StrokeCollection cachedStrokeCollection = new StrokeCollection(); + private DrawingGroup cachedDrawingGroup = new DrawingGroup(); + private bool isCached = false; + private DrawingContext context; + + public class ImprovedDrawingVisual: DrawingVisual { + public ImprovedDrawingVisual() { + CacheMode = new BitmapCache() { + EnableClearType = false, + RenderAtScale = 1, + SnapsToDevicePixels = false + }; + } + } + + public InkStrokesOverlay() + { + _children = new VisualCollection(this) { + _layer // 初始化DrawingVisual + }; + } + + protected override int VisualChildrenCount => _children.Count; + + protected override Visual GetVisualChild(int index) + { + if (index < 0 || index >= _children.Count) throw new ArgumentOutOfRangeException(); + return _children[index]; + } + + public DrawingContext Open() { + context = _layer.RenderOpen(); + return context; + } + + public void Close() { + context.Close(); + } + + public void DrawStrokes(StrokeCollection strokes, Matrix? matrixTransform, bool isOneTimeDrawing = true) { + if (isOneTimeDrawing) { + context = _layer.RenderOpen(); + } + + if (matrixTransform != null) context.PushTransform(new MatrixTransform((Matrix)matrixTransform)); + + if (strokes.Count != 0) { + if (!isCached || (isCached && !strokes.Equals(cachedStrokeCollection))) { + cachedStrokeCollection = strokes; + cachedDrawingGroup = new DrawingGroup(); + var gp_context = cachedDrawingGroup.Open(); + var stks_cloned = strokes.Clone(); + foreach (var stroke in stks_cloned) { + stroke.DrawingAttributes.Width += 2; + stroke.DrawingAttributes.Height += 2; + } + stks_cloned.Draw(gp_context); + foreach (var ori_stk in strokes) { + var geo = ori_stk.GetGeometry(); + gp_context.DrawGeometry(new SolidColorBrush(Colors.White),null,geo); + + } + gp_context.Close(); + } + } + + context.DrawDrawing(cachedDrawingGroup); + + if (matrixTransform != null) context.Pop(); + + if (isOneTimeDrawing) { + context.Close(); + } + } + } +} diff --git a/InkCanvasForClass/Helpers/PerformanceTransparentWin.Win32.cs b/InkCanvasForClass/Helpers/PerformanceTransparentWin.Win32.cs new file mode 100644 index 0000000..8746f7f --- /dev/null +++ b/InkCanvasForClass/Helpers/PerformanceTransparentWin.Win32.cs @@ -0,0 +1,600 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Ink_Canvas.Helpers { + public partial class PerformanceTransparentWin { + static class Win32 { + + public enum WM + { + NULL = 0x0000, + CREATE = 0x0001, + DESTROY = 0x0002, + MOVE = 0x0003, + SIZE = 0x0005, + ACTIVATE = 0x0006, + SETFOCUS = 0x0007, + KILLFOCUS = 0x0008, + ENABLE = 0x000A, + SETREDRAW = 0x000B, + SETTEXT = 0x000C, + GETTEXT = 0x000D, + GETTEXTLENGTH = 0x000E, + PAINT = 0x000F, + CLOSE = 0x0010, + QUERYENDSESSION = 0x0011, + QUERYOPEN = 0x0013, + ENDSESSION = 0x0016, + QUIT = 0x0012, + ERASEBKGND = 0x0014, + SYSCOLORCHANGE = 0x0015, + SHOWWINDOW = 0x0018, + WININICHANGE = 0x001A, + SETTINGCHANGE = WININICHANGE, + DEVMODECHANGE = 0x001B, + ACTIVATEAPP = 0x001C, + FONTCHANGE = 0x001D, + TIMECHANGE = 0x001E, + CANCELMODE = 0x001F, + SETCURSOR = 0x0020, + MOUSEACTIVATE = 0x0021, + CHILDACTIVATE = 0x0022, + QUEUESYNC = 0x0023, + GETMINMAXINFO = 0x0024, + PAINTICON = 0x0026, + ICONERASEBKGND = 0x0027, + NEXTDLGCTL = 0x0028, + SPOOLERSTATUS = 0x002A, + DRAWITEM = 0x002B, + MEASUREITEM = 0x002C, + DELETEITEM = 0x002D, + VKEYTOITEM = 0x002E, + CHARTOITEM = 0x002F, + SETFONT = 0x0030, + GETFONT = 0x0031, + SETHOTKEY = 0x0032, + GETHOTKEY = 0x0033, + QUERYDRAGICON = 0x0037, + COMPAREITEM = 0x0039, + GETOBJECT = 0x003D, + COMPACTING = 0x0041, + COMMNOTIFY = 0x0044 /* no longer suported */, + WINDOWPOSCHANGING = 0x0046, + WINDOWPOSCHANGED = 0x0047, + POWER = 0x0048, + COPYDATA = 0x004A, + CANCELJOURNAL = 0x004B, + NOTIFY = 0x004E, + INPUTLANGCHANGEREQUEST = 0x0050, + INPUTLANGCHANGE = 0x0051, + TCARD = 0x0052, + HELP = 0x0053, + USERCHANGED = 0x0054, + NOTIFYFORMAT = 0x0055, + CONTEXTMENU = 0x007B, + STYLECHANGING = 0x007C, + STYLECHANGED = 0x007D, + DISPLAYCHANGE = 0x007E, + GETICON = 0x007F, + SETICON = 0x0080, + NCCREATE = 0x0081, + NCDESTROY = 0x0082, + NCCALCSIZE = 0x0083, + NCHITTEST = 0x0084, + NCPAINT = 0x0085, + NCACTIVATE = 0x0086, + GETDLGCODE = 0x0087, + SYNCPAINT = 0x0088, + NCMOUSEMOVE = 0x00A0, + NCLBUTTONDOWN = 0x00A1, + NCLBUTTONUP = 0x00A2, + NCLBUTTONDBLCLK = 0x00A3, + NCRBUTTONDOWN = 0x00A4, + NCRBUTTONUP = 0x00A5, + NCRBUTTONDBLCLK = 0x00A6, + NCMBUTTONDOWN = 0x00A7, + NCMBUTTONUP = 0x00A8, + NCMBUTTONDBLCLK = 0x00A9, + NCXBUTTONDOWN = 0x00AB, + NCXBUTTONUP = 0x00AC, + NCXBUTTONDBLCLK = 0x00AD, + INPUT_DEVICE_CHANGE = 0x00FE, + INPUT = 0x00FF, + KEYFIRST = 0x0100, + KEYDOWN = 0x0100, + KEYUP = 0x0101, + CHAR = 0x0102, + DEADCHAR = 0x0103, + SYSKEYDOWN = 0x0104, + SYSKEYUP = 0x0105, + SYSCHAR = 0x0106, + SYSDEADCHAR = 0x0107, + UNICHAR = 0x0109, + KEYLAST = 0x0109, + IME_STARTCOMPOSITION = 0x010D, + IME_ENDCOMPOSITION = 0x010E, + IME_COMPOSITION = 0x010F, + IME_KEYLAST = 0x010F, + INITDIALOG = 0x0110, + COMMAND = 0x0111, + SYSCOMMAND = 0x0112, + TIMER = 0x0113, + HSCROLL = 0x0114, + VSCROLL = 0x0115, + INITMENU = 0x0116, + INITMENUPOPUP = 0x0117, + GESTURE = 0x0119, + GESTURENOTIFY = 0x011A, + MENUSELECT = 0x011F, + MENUCHAR = 0x0120, + ENTERIDLE = 0x0121, + MENURBUTTONUP = 0x0122, + MENUDRAG = 0x0123, + MENUGETOBJECT = 0x0124, + UNINITMENUPOPUP = 0x0125, + MENUCOMMAND = 0x0126, + CHANGEUISTATE = 0x0127, + UPDATEUISTATE = 0x0128, + QUERYUISTATE = 0x0129, + CTLCOLORMSGBOX = 0x0132, + CTLCOLOREDIT = 0x0133, + CTLCOLORLISTBOX = 0x0134, + CTLCOLORBTN = 0x0135, + CTLCOLORDLG = 0x0136, + CTLCOLORSCROLLBAR = 0x0137, + CTLCOLORSTATIC = 0x0138, + MOUSEFIRST = 0x0200, + MOUSEMOVE = 0x0200, + LBUTTONDOWN = 0x0201, + LBUTTONUP = 0x0202, + LBUTTONDBLCLK = 0x0203, + RBUTTONDOWN = 0x0204, + RBUTTONUP = 0x0205, + RBUTTONDBLCLK = 0x0206, + MBUTTONDOWN = 0x0207, + MBUTTONUP = 0x0208, + MBUTTONDBLCLK = 0x0209, + MOUSEWHEEL = 0x020A, + XBUTTONDOWN = 0x020B, + XBUTTONUP = 0x020C, + XBUTTONDBLCLK = 0x020D, + MOUSEHWHEEL = 0x020E, + MOUSELAST = 0x020E, + PARENTNOTIFY = 0x0210, + ENTERMENULOOP = 0x0211, + EXITMENULOOP = 0x0212, + NEXTMENU = 0x0213, + SIZING = 0x0214, + CAPTURECHANGED = 0x0215, + MOVING = 0x0216, + POWERBROADCAST = 0x0218, + DEVICECHANGE = 0x0219, + MDICREATE = 0x0220, + MDIDESTROY = 0x0221, + MDIACTIVATE = 0x0222, + MDIRESTORE = 0x0223, + MDINEXT = 0x0224, + MDIMAXIMIZE = 0x0225, + MDITILE = 0x0226, + MDICASCADE = 0x0227, + MDIICONARRANGE = 0x0228, + MDIGETACTIVE = 0x0229, + MDISETMENU = 0x0230, + ENTERSIZEMOVE = 0x0231, + EXITSIZEMOVE = 0x0232, + DROPFILES = 0x0233, + MDIREFRESHMENU = 0x0234, + POINTERDEVICECHANGE = 0x238, + POINTERDEVICEINRANGE = 0x239, + POINTERDEVICEOUTOFRANGE = 0x23A, + TOUCH = 0x0240, + NCPOINTERUPDATE = 0x0241, + NCPOINTERDOWN = 0x0242, + NCPOINTERUP = 0x0243, + POINTERUPDATE = 0x0245, + POINTERDOWN = 0x0246, + POINTERUP = 0x0247, + POINTERENTER = 0x0249, + POINTERLEAVE = 0x024A, + POINTERACTIVATE = 0x024B, + POINTERCAPTURECHANGED = 0x024C, + TOUCHHITTESTING = 0x024D, + POINTERWHEEL = 0x024E, + POINTERHWHEEL = 0x024F, + IME_SETCONTEXT = 0x0281, + IME_NOTIFY = 0x0282, + IME_CONTROL = 0x0283, + IME_COMPOSITIONFULL = 0x0284, + IME_SELECT = 0x0285, + IME_CHAR = 0x0286, + IME_REQUEST = 0x0288, + IME_KEYDOWN = 0x0290, + IME_KEYUP = 0x0291, + MOUSEHOVER = 0x02A1, + MOUSELEAVE = 0x02A3, + NCMOUSEHOVER = 0x02A0, + NCMOUSELEAVE = 0x02A2, + WTSSESSION_CHANGE = 0x02B1, + TABLET_FIRST = 0x02c0, + TABLET_LAST = 0x02df, + DPICHANGED = 0x02E0, + CUT = 0x0300, + COPY = 0x0301, + PASTE = 0x0302, + CLEAR = 0x0303, + UNDO = 0x0304, + RENDERFORMAT = 0x0305, + RENDERALLFORMATS = 0x0306, + DESTROYCLIPBOARD = 0x0307, + DRAWCLIPBOARD = 0x0308, + PAINTCLIPBOARD = 0x0309, + VSCROLLCLIPBOARD = 0x030A, + SIZECLIPBOARD = 0x030B, + ASKCBFORMATNAME = 0x030C, + CHANGECBCHAIN = 0x030D, + HSCROLLCLIPBOARD = 0x030E, + QUERYNEWPALETTE = 0x030F, + PALETTEISCHANGING = 0x0310, + PALETTECHANGED = 0x0311, + HOTKEY = 0x0312, + PRINT = 0x0317, + PRINTCLIENT = 0x0318, + APPCOMMAND = 0x0319, + THEMECHANGED = 0x031A, + CLIPBOARDUPDATE = 0x031D, + DWMCOMPOSITIONCHANGED = 0x031E, + DWMNCRENDERINGCHANGED = 0x031F, + DWMCOLORIZATIONCOLORCHANGED = 0x0320, + DWMWINDOWMAXIMIZEDCHANGE = 0x0321, + DWMSENDICONICTHUMBNAIL = 0x0323, + DWMSENDICONICLIVEPREVIEWBITMAP = 0x0326, + GETTITLEBARINFOEX = 0x033F, + HANDHELDFIRST = 0x0358, + HANDHELDLAST = 0x035F, + AFXFIRST = 0x0360, + AFXLAST = 0x037F, + PENWINFIRST = 0x0380, + PENWINLAST = 0x038F, + APP = 0x8000, + USER = 0x0400 + } + + /// + /// 扩展的窗口风格 + /// 这是 long 类型的,如果想要使用 int 类型请使用 类 + /// + /// 代码:[Extended Window Styles (Windows)](https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543(v=vs.85).aspx ) + /// code from [Extended Window Styles (Windows)](https://msdn.microsoft.com/en-us/library/windows/desktop/ff700543(v=vs.85).aspx ) + [Flags] + public enum ExtendedWindowStyles : long { + /// + /// The window accepts drag-drop files + /// + WS_EX_ACCEPTFILES = 0x00000010L, + + /// + /// Forces a top-level window onto the taskbar when the window is visible + /// + WS_EX_APPWINDOW = 0x00040000L, + + /// + /// The window has a border with a sunken edge. + /// + WS_EX_CLIENTEDGE = 0x00000200L, + + /// + /// Paints all descendants of a window in bottom-to-top painting order using double-buffering. For more information, see Remarks. This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC.Windows 2000: This style is not supported. + /// + WS_EX_COMPOSITED = 0x02000000L, + + /// + /// The title bar of the window includes a question mark. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window.WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles. + /// + WS_EX_CONTEXTHELP = 0x00000400L, + + /// + /// The window itself contains child windows that should take part in dialog box navigation. If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic. + /// + WS_EX_CONTROLPARENT = 0x00010000L, + + /// + /// The window has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter. + /// + WS_EX_DLGMODALFRAME = 0x00000001L, + + /// + /// The window is a layered window. This style cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC.Windows 8: The WS_EX_LAYERED style is supported for top-level windows and child windows. Previous Windows versions support WS_EX_LAYERED only for top-level windows. + /// + WS_EX_LAYERED = 0x00080000, + + /// + /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the horizontal origin of the window is on the right edge. Increasing horizontal values advance to the left. + /// + WS_EX_LAYOUTRTL = 0x00400000L, + + /// + /// The window has generic left-aligned properties. This is the default. + /// + WS_EX_LEFT = 0x00000000L, + + /// + /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored. + /// + WS_EX_LEFTSCROLLBAR = 0x00004000L, + + /// + /// The window text is displayed using left-to-right reading-order properties. This is the default. + /// + WS_EX_LTRREADING = 0x00000000L, + + /// + /// The window is a MDI child window. + /// + WS_EX_MDICHILD = 0x00000040L, + + /// + /// A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window.To activate the window, use the SetActiveWindow or SetForegroundWindow function.The window does not appear on the taskbar by default. To force the window to appear on the taskbar, use the WS_EX_APPWINDOW style. + /// + WS_EX_NOACTIVATE = 0x08000000L, + + /// + /// The window does not pass its window layout to its child windows. + /// + WS_EX_NOINHERITLAYOUT = 0x00100000L, + + /// + /// The child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed. + /// + WS_EX_NOPARENTNOTIFY = 0x00000004L, + + /// + /// The window does not render to a redirection surface. This is for windows that do not have visible content or that use mechanisms other than surfaces to provide their visual. + /// + WS_EX_NOREDIRECTIONBITMAP = 0x00200000L, + + /// + /// The window is an overlapped window. + /// + WS_EX_OVERLAPPEDWINDOW = (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE), + + /// + /// The window is palette window, which is a modeless dialog box that presents an array of commands. + /// + WS_EX_PALETTEWINDOW = (WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST), + + /// + /// The window has generic "right-aligned" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading-order alignment; otherwise, the style is ignored.Using the WS_EX_RIGHT style for static or edit controls has the same effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles. + /// + WS_EX_RIGHT = 0x00001000L, + + /// + /// The vertical scroll bar (if present) is to the right of the client area. This is the default. + /// + WS_EX_RIGHTSCROLLBAR = 0x00000000L, + + /// + /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored. + /// + WS_EX_RTLREADING = 0x00002000L, + + /// + /// The window has a three-dimensional border style intended to be used for items that do not accept user input. + /// + WS_EX_STATICEDGE = 0x00020000L, + + /// + /// The window is intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE. + /// + WS_EX_TOOLWINDOW = 0x00000080L, + + /// + /// The window should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function. + /// + WS_EX_TOPMOST = 0x00000008L, + + /// + /// The window should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted.To achieve transparency without these restrictions, use the SetWindowRgn function. + /// + WS_EX_TRANSPARENT = 0x00000020L, + + /// + /// The window has a border with a raised edge + /// + WS_EX_WINDOWEDGE = 0x00000100L + } + + public static partial class User32 { + /// + /// 获得指定窗口的信息 + /// + /// 指定窗口的句柄 + /// 需要获得的信息的类型 请使用 + /// + // This static method is required because Win32 does not support + // GetWindowLongPtr directly + public static IntPtr GetWindowLongPtr(IntPtr hWnd, GetWindowLongFields nIndex) => + GetWindowLongPtr(hWnd, (int)nIndex); + + /// + /// 获得指定窗口的信息 + /// + /// 指定窗口的句柄 + /// 需要获得的信息的类型 请使用 + /// + // This static method is required because Win32 does not support + // GetWindowLongPtr directly + public static IntPtr GetWindowLongPtr(IntPtr hWnd, int nIndex) { + return IntPtr.Size > 4 +#pragma warning disable CS0618 // 类型或成员已过时 + ? GetWindowLongPtr_x64(hWnd, nIndex) + : new IntPtr(GetWindowLong(hWnd, nIndex)); +#pragma warning restore CS0618 // 类型或成员已过时 + } + + /// + /// 获得指定窗口的信息 + /// + /// 指定窗口的句柄 + /// 需要获得的信息的类型 请使用 + /// + [Obsolete("请使用 GetWindowLongPtr 解决 x86 和 x64 需要使用不同方法")] + [DllImport(LibraryName, CharSet = Properties.BuildCharSet)] + public static extern int GetWindowLong(IntPtr hWnd, int nIndex); + + /// + /// 获得指定窗口的信息 + /// + /// 指定窗口的句柄 + /// 需要获得的信息的类型 请使用 + /// + [Obsolete("请使用 GetWindowLongPtr 解决 x86 和 x64 需要使用不同方法")] + [DllImport(LibraryName, CharSet = Properties.BuildCharSet, EntryPoint = "GetWindowLongPtr")] + public static extern IntPtr GetWindowLongPtr_x64(IntPtr hWnd, int nIndex); + + /// + /// 改变指定窗口的属性 + /// + /// 窗口句柄 + /// + /// 指定将设定的大于等于0的偏移值。有效值的范围从0到额外类的存储空间的字节数减4:例如若指定了12或多于12个字节的额外窗口存储空间,则应设索引位8来访问第三个4字节,同样设置0访问第一个4字节,4访问第二个4字节。要设置其他任何值,可以指定下面值之一 + /// 从 GetWindowLongFields 可以找到所有的值 + /// + /// 指定的替换值 + /// + public static IntPtr SetWindowLongPtr(IntPtr hWnd, GetWindowLongFields nIndex, IntPtr dwNewLong) => + SetWindowLongPtr(hWnd, (int)nIndex, dwNewLong); + + /// + /// 改变指定窗口的属性 + /// + /// 窗口句柄 + /// 指定将设定的大于等于0的偏移值。有效值的范围从0到额外类的存储空间的字节数减4:例如若指定了12或多于12个字节的额外窗口存储空间,则应设索引位8来访问第三个4字节,同样设置0访问第一个4字节,4访问第二个4字节。要设置其他任何值,可以指定下面值之一 + /// 从 GetWindowLongFields 可以找到所有的值 + /// + /// GetWindowLongFields.GWL_EXSTYLE -20 设定一个新的扩展风格。 + /// GWL_HINSTANCE -6 设置一个新的应用程序实例句柄。 + /// GWL_ID -12 设置一个新的窗口标识符。 + /// GWL_STYLE -16 设定一个新的窗口风格。 + /// GWL_USERDATA -21 设置与窗口有关的32位值。每个窗口均有一个由创建该窗口的应用程序使用的32位值。 + /// GWL_WNDPROC -4 为窗口设定一个新的处理函数。 + /// GWL_HWNDPARENT -8 改变子窗口的父窗口,应使用SetParent函数 + /// + /// 指定的替换值 + /// + // This static method is required because Win32 does not support + // GetWindowLongPtr directly + public static IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong) { + return IntPtr.Size > 4 +#pragma warning disable CS0618 // 类型或成员已过时 + ? SetWindowLongPtr_x64(hWnd, nIndex, dwNewLong) + : new IntPtr(SetWindowLong(hWnd, nIndex, dwNewLong.ToInt32())); +#pragma warning restore CS0618 // 类型或成员已过时 + } + + /// + /// 改变指定窗口的属性 + /// + /// 窗口句柄 + /// 指定将设定的大于等于0的偏移值。有效值的范围从0到额外类的存储空间的字节数减4:例如若指定了12或多于12个字节的额外窗口存储空间,则应设索引位8来访问第三个4字节,同样设置0访问第一个4字节,4访问第二个4字节。要设置其他任何值,可以指定下面值之一 + /// 从 GetWindowLongFields 可以找到所有的值 + /// + /// GetWindowLongFields.GWL_EXSTYLE -20 设定一个新的扩展风格。 + /// GWL_HINSTANCE -6 设置一个新的应用程序实例句柄。 + /// GWL_ID -12 设置一个新的窗口标识符。 + /// GWL_STYLE -16 设定一个新的窗口风格。 + /// GWL_USERDATA -21 设置与窗口有关的32位值。每个窗口均有一个由创建该窗口的应用程序使用的32位值。 + /// GWL_WNDPROC -4 为窗口设定一个新的处理函数。 + /// GWL_HWNDPARENT -8 改变子窗口的父窗口,应使用SetParent函数 + /// + /// 指定的替换值 + /// + [Obsolete("请使用 SetWindowLongPtr 解决 x86 和 x64 需要使用不同方法")] + [DllImport(LibraryName, CharSet = Properties.BuildCharSet)] + public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); + + /// + /// 改变指定窗口的属性 + /// + /// 窗口句柄 + /// 指定将设定的大于等于0的偏移值。有效值的范围从0到额外类的存储空间的字节数减4:例如若指定了12或多于12个字节的额外窗口存储空间,则应设索引位8来访问第三个4字节,同样设置0访问第一个4字节,4访问第二个4字节。要设置其他任何值,可以指定下面值之一 + /// 从 GetWindowLongFields 可以找到所有的值 + /// + /// GetWindowLongFields.GWL_EXSTYLE -20 设定一个新的扩展风格。 + /// GWL_HINSTANCE -6 设置一个新的应用程序实例句柄。 + /// GWL_ID -12 设置一个新的窗口标识符。 + /// GWL_STYLE -16 设定一个新的窗口风格。 + /// GWL_USERDATA -21 设置与窗口有关的32位值。每个窗口均有一个由创建该窗口的应用程序使用的32位值。 + /// GWL_WNDPROC -4 为窗口设定一个新的处理函数。 + /// GWL_HWNDPARENT -8 改变子窗口的父窗口,应使用SetParent函数 + /// + /// 指定的替换值 + /// + [DllImport(LibraryName, CharSet = Properties.BuildCharSet, EntryPoint = "SetWindowLongPtr")] + [Obsolete("请使用 SetWindowLongPtr 解决 x86 和 x64 需要使用不同方法")] + public static extern IntPtr SetWindowLongPtr_x64(IntPtr hWnd, int nIndex, IntPtr dwNewLong); + + public const string LibraryName = "user32"; + } + + internal static class Properties { +#if !ANSI + public const CharSet BuildCharSet = CharSet.Unicode; +#else + public const CharSet BuildCharSet = CharSet.Ansi; +#endif + } + + /// + /// 用于在 的 int index 传入 + /// + /// 代码:[GetWindowLong function (Windows)](https://msdn.microsoft.com/en-us/library/windows/desktop/ms633584(v=vs.85).aspx ) + public enum GetWindowLongFields { + /// + /// 设定一个新的扩展风格 + /// Retrieves the extended window styles + /// + GWL_EXSTYLE = -20, + + /// + /// 设置一个新的应用程序实例句柄 + /// Retrieves a handle to the application instance + /// + GWL_HINSTANCE = -6, + + /// + /// 改变子窗口的父窗口 + /// Retrieves a handle to the parent window, if any + /// + GWL_HWNDPARENT = -8, + + /// + /// 设置一个新的窗口标识符 + /// Retrieves the identifier of the window + /// + GWL_ID = -12, + + /// + /// 设定一个新的窗口风格 + /// Retrieves the window styles + /// + GWL_STYLE = -16, + + /// + /// 设置与窗口有关的32位值。每个窗口均有一个由创建该窗口的应用程序使用的32位值 + /// Retrieves the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero + /// + GWL_USERDATA = -21, + + /// + /// 为窗口设定一个新的处理函数 + /// Retrieves the address of the window procedure, or a handle representing the address of the window procedure. You must use the CallWindowProc function to call the window procedure + /// + GWL_WNDPROC = -4, + } + } + } +} \ No newline at end of file diff --git a/InkCanvasForClass/Helpers/PerformanceTransparentWin.cs b/InkCanvasForClass/Helpers/PerformanceTransparentWin.cs new file mode 100644 index 0000000..c61cf2a --- /dev/null +++ b/InkCanvasForClass/Helpers/PerformanceTransparentWin.cs @@ -0,0 +1,205 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrayNotify; +using System.Windows.Controls; +using System.Windows.Interop; +using System.Windows.Shell; +using System.Windows; +using System.Windows.Media; + +namespace Ink_Canvas.Helpers +{ + /// + /// 高性能透明桌面窗口 + /// + public partial class PerformanceTransparentWin : Window + { + + static class BrushCreator + { + /// + /// 尝试从缓存获取或创建颜色笔刷 + /// + /// 对应的字符串颜色 + /// 已经被 Freeze 的颜色笔刷 + public static SolidColorBrush GetOrCreate(string color) + { + if (!color.StartsWith("#")) + { + throw new ArgumentException($"输入的{nameof(color)}不是有效颜色,需要使用 # 开始"); + // 如果不使用 # 开始将会在 ConvertFromString 出现异常 + } + + if (TryGetBrush(color, out var brushValue)) + { + return (SolidColorBrush)brushValue; + } + + object convertColor; + + try + { + convertColor = ColorConverter.ConvertFromString(color); + } + catch (FormatException) + { + // 因为在 ConvertFromString 会抛出的是 令牌无效 难以知道是为什么传入的不对 + throw new ArgumentException($"输入的{nameof(color)}不是有效颜色"); + } + + if (convertColor == null) + { + throw new ArgumentException($"输入的{nameof(color)}不是有效颜色"); + } + + var brush = new SolidColorBrush((Color)convertColor); + if (TryFreeze(brush)) + { + BrushCacheList.Add(color, new WeakReference(brush)); + } + + return brush; + } + + private static Dictionary> BrushCacheList { get; } = + new Dictionary>(); + + private static bool TryGetBrush(string key, out Brush brush) + { + if (BrushCacheList.TryGetValue(key, out var brushValue)) + { + if (brushValue.TryGetTarget(out brush)) + { + return true; + } + else + { + // 被回收的资源 + BrushCacheList.Remove(key); + } + } + + brush = null; + return false; + } + + private static bool TryFreeze(Freezable freezable) + { + if (freezable.CanFreeze) + { + freezable.Freeze(); + return true; + } + + return false; + } + } + + /// + /// 创建高性能透明桌面窗口 + /// + public PerformanceTransparentWin() + { + WindowStyle = WindowStyle.None; + ResizeMode = ResizeMode.NoResize; + + WindowChrome.SetWindowChrome(this, + new WindowChrome { GlassFrameThickness = WindowChrome.GlassFrameCompleteThickness, CaptionHeight = 0 }); + + var visualTree = new FrameworkElementFactory(typeof(Border)); + visualTree.SetValue(Border.BackgroundProperty, new TemplateBindingExtension(Window.BackgroundProperty)); + var childVisualTree = new FrameworkElementFactory(typeof(ContentPresenter)); + childVisualTree.SetValue(UIElement.ClipToBoundsProperty, true); + visualTree.AppendChild(childVisualTree); + + Template = new ControlTemplate + { + TargetType = typeof(Window), + VisualTree = visualTree, + }; + + _dwmEnabled = DwmCompositionHelper.DwmIsCompositionEnabled(); + if (_dwmEnabled) + { + _hwnd = new WindowInteropHelper(this).EnsureHandle(); + Loaded += PerformanceDesktopTransparentWindow_Loaded; + Background = Brushes.Transparent; + } + else + { + AllowsTransparency = true; + Background = BrushCreator.GetOrCreate("#0100000"); + _hwnd = new WindowInteropHelper(this).EnsureHandle(); + } + } + + /// + /// 设置点击穿透到后面透明的窗口 + /// + public void SetTransparentHitThrough() + { + if (_dwmEnabled) + { + Win32.User32.SetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE, + (IntPtr)(int)((long)Win32.User32.GetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE) | (long)Win32.ExtendedWindowStyles.WS_EX_TRANSPARENT)); + } + else + { + Background = Brushes.Transparent; + } + } + + /// + /// 设置点击命中,不会穿透到后面的窗口 + /// + public void SetTransparentNotHitThrough() + { + if (_dwmEnabled) + { + Win32.User32.SetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE, + (IntPtr)(int)((long)Win32.User32.GetWindowLongPtr(_hwnd, Win32.GetWindowLongFields.GWL_EXSTYLE) & ~(long)Win32.ExtendedWindowStyles.WS_EX_TRANSPARENT)); + } + else + { + Background = BrushCreator.GetOrCreate("#0100000"); + } + } + + [StructLayout(LayoutKind.Sequential)] + private struct STYLESTRUCT + { + public int styleOld; + public int styleNew; + } + + private void PerformanceDesktopTransparentWindow_Loaded(object sender, RoutedEventArgs e) + { + ((HwndSource)PresentationSource.FromVisual(this)).AddHook((IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) => + { + //想要让窗口透明穿透鼠标和触摸等,需要同时设置 WS_EX_LAYERED 和 WS_EX_TRANSPARENT 样式, + //确保窗口始终有 WS_EX_LAYERED 这个样式,并在开启穿透时设置 WS_EX_TRANSPARENT 样式 + //但是WPF窗口在未设置 AllowsTransparency = true 时,会自动去掉 WS_EX_LAYERED 样式(在 HwndTarget 类中), + //如果设置了 AllowsTransparency = true 将使用WPF内置的低性能的透明实现, + //所以这里通过 Hook 的方式,在不使用WPF内置的透明实现的情况下,强行保证这个样式存在。 + if (msg == (int)Win32.WM.STYLECHANGING && (long)wParam == (long)Win32.GetWindowLongFields.GWL_EXSTYLE) + { + var styleStruct = (STYLESTRUCT)Marshal.PtrToStructure(lParam, typeof(STYLESTRUCT)); + styleStruct.styleNew |= (int)Win32.ExtendedWindowStyles.WS_EX_LAYERED; + Marshal.StructureToPtr(styleStruct, lParam, false); + handled = true; + } + return IntPtr.Zero; + }); + } + + /// + /// 是否开启 DWM 了,如果开启了,那么才可以使用高性能的桌面透明窗口 + /// + private readonly bool _dwmEnabled; + private readonly IntPtr _hwnd; + } +} diff --git a/InkCanvasForClass/Helpers/RectangleSelectionViewer.cs b/InkCanvasForClass/Helpers/RectangleSelectionViewer.cs new file mode 100644 index 0000000..79e70dc --- /dev/null +++ b/InkCanvasForClass/Helpers/RectangleSelectionViewer.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Windows; +using System.Windows.Ink; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; + +namespace Ink_Canvas.Helpers +{ + + public class RectangleSelectionViewer : FrameworkElement + { + private VisualCollection _children; + private DrawingVisual _layer = new DrawingVisual(); + private Pen defaultPen = new Pen(); + + public RectangleSelectionViewer() + { + _children = new VisualCollection(this) { + _layer // 初始化DrawingVisual + }; + defaultPen.Thickness = 2; + defaultPen.Brush = new SolidColorBrush(Color.FromRgb(37, 99, 235)); + defaultPen.DashStyle = DashStyles.Dash; + } + + protected override int VisualChildrenCount => _children.Count; + + protected override Visual GetVisualChild(int index) + { + if (index < 0 || index >= _children.Count) throw new ArgumentOutOfRangeException(); + return _children[index]; + } + + public void DrawSelectionBox(Rect rect) { + DrawingContext context = _layer.RenderOpen(); + context.DrawRoundedRectangle(new SolidColorBrush(Color.FromArgb(78, 96, 165, 250)), defaultPen, rect, 4, 4); + context.Close(); + } + + public void ClearDrawing() { + DrawingContext context = _layer.RenderOpen(); + context.Close(); + } + } +} diff --git a/InkCanvasForClass/InkCanvasForClass.csproj b/InkCanvasForClass/InkCanvasForClass.csproj index f1d7ebc..dfbd0d9 100644 --- a/InkCanvasForClass/InkCanvasForClass.csproj +++ b/InkCanvasForClass/InkCanvasForClass.csproj @@ -147,7 +147,9 @@ + + @@ -183,7 +185,11 @@ - + + + + + @@ -343,6 +349,7 @@ + @@ -489,7 +496,11 @@ - + + + + + @@ -531,6 +542,7 @@ + diff --git a/InkCanvasForClass/InkCanvasForClass.csproj.user b/InkCanvasForClass/InkCanvasForClass.csproj.user index 2ece275..a01fe20 100644 --- a/InkCanvasForClass/InkCanvasForClass.csproj.user +++ b/InkCanvasForClass/InkCanvasForClass.csproj.user @@ -11,10 +11,31 @@ Code + + Code + + + Designer + + + Designer + Designer + + Designer + + + Designer + + + Designer + + + Designer + \ No newline at end of file diff --git a/InkCanvasForClass/MainWindow.xaml b/InkCanvasForClass/MainWindow.xaml index db5ff0c..4628ccd 100644 --- a/InkCanvasForClass/MainWindow.xaml +++ b/InkCanvasForClass/MainWindow.xaml @@ -6,8 +6,9 @@ xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:c="clr-namespace:Ink_Canvas.Converter" xmlns:Controls="http://schemas.microsoft.com/netfx/2009/xaml/presentation" xmlns:popups="clr-namespace:Ink_Canvas.Popups" + xmlns:inkCanvas="clr-namespace:Ink_Canvas" + xmlns:helpers="clr-namespace:Ink_Canvas.Helpers" mc:Ignorable="d" - AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize" WindowState="Maximized" @@ -20,6 +21,7 @@ Closing="Window_Closing" Closed="Window_Closed" PreviewKeyDown="Main_Grid_PreviewKeyDown" + PreviewKeyUp="Main_Grid_PreviewKeyUp" Height="12000" Width="1440" FontFamily="Microsoft YaHei UI" MouseWheel="Window_MouseWheel" @@ -30,31 +32,41 @@ Stylus.IsFlicksEnabled="False" Stylus.IsTapFeedbackEnabled="False" DpiChanged="MainWindow_OnDpiChanged" + PreviewStylusButtonDown="mainWin_StylusButtonDown" + PreviewStylusButtonUp="mainWin_StylusButtonUp" + PreviewStylusMove="mainWin_StylusMove" + PreviewStylusInAirMove="mainWin_StylusInAirMove" Stylus.IsTouchFeedbackEnabled="False"> - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -106,8 +118,8 @@ - - + + @@ -117,26 +129,27 @@ + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - + @@ -2224,13 +2437,13 @@ + Opacity="{Binding ElementName=SymbolIconUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"> @@ -2242,7 +2455,8 @@ - @@ -2250,13 +2464,13 @@ MouseDown="Border_MouseDown" MouseUp="SymbolIconRedo_MouseUp" BorderThickness="0,1,1,1" BorderBrush="#a1a1aa" - IsEnabled="{Binding ElementName=BtnRedo, Path=IsEnabled}" + IsEnabled="{Binding ElementName=SymbolIconRedo, Path=IsEnabled}" Background="#f4f4f5" Opacity="0.95"> + Opacity="{Binding ElementName=SymbolIconRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"> @@ -2268,7 +2482,7 @@ - @@ -2810,7 +3024,7 @@ - @@ -2827,7 +3041,7 @@ Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}" /> - + --> @@ -4459,11 +4673,11 @@ MouseLeave="FloatingBarToolBtnMouseLeaveFeedback_Panel" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" Margin="0,-2" - IsEnabled="{Binding ElementName=BtnUndo, Path=IsEnabled}" + IsEnabled="False" Width="28"> + Opacity="{Binding ElementName=SymbolIconUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"> @@ -4476,7 +4690,7 @@ @@ -4487,11 +4701,11 @@ MouseLeave="FloatingBarToolBtnMouseLeaveFeedback_Panel" Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center" - IsEnabled="{Binding ElementName=BtnRedo, Path=IsEnabled}" + IsEnabled="False" Width="28" Margin="0,-2"> + Opacity="{Binding ElementName=SymbolIconRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"> @@ -4504,7 +4718,7 @@ @@ -5055,7 +5269,7 @@ MouseDown="Border_MouseDown" MouseUp="ImagePPTControlEnd_MouseUp" Background="{DynamicResource FloatBarBackground}" CornerRadius="4" BorderThickness="1" BorderBrush="{DynamicResource FloatBarBorderBrush}" - Visibility="{Binding ElementName=BtnPPTSlideShowEnd, Path=Visibility}"> + Visibility="Collapsed"> @@ -5580,10 +5794,43 @@ - + + + + + + + + + + + + + + + + + + + + + + + + @@ -6019,6 +6266,61 @@ FontFamily="Microsoft YaHei UI" FontWeight="Bold" Toggled="ToggleSwitchEnableMouseWheelGesture_Toggled" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6704,17 +7006,6 @@ IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" Toggled="ToggleSwitchEnableTwoFingerGestureInPresentationMode_Toggled" /> - - - - - @@ -6982,6 +7273,37 @@ Name="ToggleSwitchIsDisableCloseWindow" IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold" /> + + + + + + + + + + + + + + + + + + + + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + @@ -7703,11 +8025,11 @@ 0% - - - + + + diff --git a/InkCanvasForClass/Popups/ColorPalette.xaml.cs b/InkCanvasForClass/Popups/ColorPalette.xaml.cs index e396f21..821a835 100644 --- a/InkCanvasForClass/Popups/ColorPalette.xaml.cs +++ b/InkCanvasForClass/Popups/ColorPalette.xaml.cs @@ -16,8 +16,14 @@ using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using ColorPicker; using iNKORE.UI.WPF.Helpers; using static Ink_Canvas.Popups.ColorPalette; +using System.Drawing; +using Ink_Canvas.Helpers; +using Color = System.Windows.Media.Color; +using Point = System.Windows.Point; +using Image = System.Windows.Controls.Image; namespace Ink_Canvas.Popups { public partial class ColorPalette : UserControl { @@ -36,10 +42,11 @@ namespace Ink_Canvas.Popups { ColorPurple, ColorFuchsia, ColorPink, - ColorRose + ColorRose, + ColorCustom }; - private Color[] _lightColors = new Color[] { + private Color[] _darkColors = new Color[] { Color.FromRgb(9, 9, 11), Color.FromRgb(250, 250, 250), Color.FromRgb(220, 38, 38), @@ -48,7 +55,7 @@ namespace Ink_Canvas.Popups { Color.FromRgb(101, 163, 13), Color.FromRgb(22, 163, 74), Color.FromRgb(13, 148, 136), - Color.FromRgb(2, 132, 199), + Color.FromRgb(8, 145, 178), Color.FromRgb(37, 99, 235), Color.FromRgb(79, 70, 229), Color.FromRgb(124, 58, 237), @@ -57,6 +64,24 @@ namespace Ink_Canvas.Popups { Color.FromRgb(225, 29, 72), }; + private Color[] _lightColors = new Color[] { + Color.FromRgb(9, 9, 11), + Color.FromRgb(250, 250, 250), + Color.FromRgb(239, 68, 68), + Color.FromRgb(249, 115, 22), + Color.FromRgb(253, 224, 71), + Color.FromRgb(163, 230, 53), + Color.FromRgb(74, 222, 128), + Color.FromRgb(94, 234, 212), + Color.FromRgb(34, 211, 238), + Color.FromRgb(59, 130, 246), + Color.FromRgb(129, 140, 248), + Color.FromRgb(168, 85, 247), + Color.FromRgb(217, 70, 239), + Color.FromRgb(236, 72, 153), + Color.FromRgb(244, 63, 94), + }; + public string[] ColorPaletteColorStrings = new[] { "black", "white", "red", "orange", "yellow", "lime", "green", "teal", "cyan", "blue", "indigo", "purple", "fuchsia", "pink", "rose" @@ -68,6 +93,22 @@ namespace Ink_Canvas.Popups { public GeometryDrawing[] PenModeTabButtonIcons; public TextBlock[] PenModeTabButtonTexts; + private bool _usingDarkColors = true; + + public bool UsingDarkColors { + get => _usingDarkColors; + set { + var pre = _usingDarkColors; + _usingDarkColors = value; + ColorModeChanged?.Invoke(this, new ColorModeChangedEventArgs() + { + IsPreviousUsedDarkColor = pre, + IsNowUsingDarkColor = value, + TriggerMode = TriggerMode.TriggeredByCode, + }); + } + } + private ColorPaletteColor _colorSelected = ColorPaletteColor.ColorRed; public ColorPaletteColor SelectedColor { get => _colorSelected; @@ -114,7 +155,6 @@ namespace Ink_Canvas.Popups { var recogQua = ircm.Items[3] as MenuItem; var recogEll = ircm.Items[4] as MenuItem; var recogPlg = ircm.Items[5] as MenuItem; - var ft2Curve = ircm.Items[7] as MenuItem; var recogSub = new MenuItem[] { recogTri, recogQua, recogEll, recogPlg, }; @@ -233,11 +273,13 @@ namespace Ink_Canvas.Popups { var pressSub = new MenuItem[] { pointSP, velocitySP, noneSP }; + isSimulatePressureCheckedByUser = false; foreach (var mi in pressSub) { if (mi.Name=="PointSP") mi.IsChecked = _simulatePressure == PressureSimulation.PointSimulate; else if (mi.Name == "VelocitySP") mi.IsChecked = _simulatePressure == PressureSimulation.VelocitySimulate; else if (mi.Name == "NoneSP") mi.IsChecked = _simulatePressure == PressureSimulation.None; } + isSimulatePressureCheckedByUser = true; } private void SimulatePressureContextMenu_Closed(object sender, RoutedEventArgs e) { @@ -250,8 +292,23 @@ namespace Ink_Canvas.Popups { UpdateSimulatePressureContextMenuDisplayStatus(); } + private bool isSimulatePressureCheckedByUser = true; + private void SimulatePressureContextMenuItem_Checked(object sender, RoutedEventArgs e) { - + if (!isSimulatePressureCheckedByUser) return; + var mi = (MenuItem)sender; + var pre = _simulatePressure; + Trace.WriteLine(mi.Name); + _simulatePressure = mi.Name == "PointSP" ? PressureSimulation.PointSimulate : mi.Name == "VelocitySP" ? PressureSimulation.VelocitySimulate : PressureSimulation.None; + SimulatePressureToggleSwitchImage.Source = + this.FindResource(_simulatePressure != PressureSimulation.None ? "SwitchOnImage" : "SwitchOffImage") as DrawingImage; + UpdateSimulatePressureContextMenuDisplayStatus(); + PressureSimulationChanged?.Invoke(this, new PressureSimulationChangedEventArgs() + { + PreviousMode = pre, + NowMode = _simulatePressure, + TriggerMode = TriggerMode.TriggeredByUser, + }); } private void SimulatePressureToggleSwitchButton_Clicked(object sender, RoutedEventArgs e) { @@ -284,6 +341,8 @@ namespace Ink_Canvas.Popups { bd.Child = null; } + UpdateCustomColorButtonDisplayStatus(); + if (_colorSelected == ColorPaletteColor.ColorCustom) return; var index = (int)_colorSelected; var bdSel = ColorPaletteColorButtonBorders[index]; Image checkedImage = new Image(); @@ -291,8 +350,7 @@ namespace Ink_Canvas.Popups { checkedImage.Height = 24; var checkLight = this.FindResource("CheckedLightIcon"); var checkDark = this.FindResource("CheckedDarkIcon"); - if (_colorSelected == ColorPaletteColor.ColorWhite - || _colorSelected == ColorPaletteColor.ColorYellow) checkedImage.Source = checkDark as DrawingImage; + if (ColorUtilities.GetReverseForegroundColor(ColorUtilities.GetGrayLevel((_usingDarkColors?_darkColors:_lightColors)[(int)_colorSelected])) == Colors.Black) checkedImage.Source = checkDark as DrawingImage; else checkedImage.Source = checkLight as DrawingImage; bdSel.Child = checkedImage; } @@ -355,6 +413,43 @@ namespace Ink_Canvas.Popups { }); } + private void UpdateCustomColorPickerDisplayStatus() { + if (_customColor == null) { + CustomColorHexTextBox.Text = "请在上方选择一个颜色"; + CustomColorHexBorder.Background = new SolidColorBrush(Colors.Transparent); + } else { + CustomColorHexTextBox.Text = "#" + CustomColorPicker.SelectedColor.R.ToString("X2") + CustomColorPicker.SelectedColor.G.ToString("X2") + CustomColorPicker.SelectedColor.B.ToString("X2"); + CustomColorHexBorder.Background = new SolidColorBrush(CustomColorPicker.SelectedColor); + } + } + + private void UpdateCustomColorButtonDisplayStatus() { + if (_customColor == null) { + CustomColorButtonColorBorder.Visibility = Visibility.Collapsed; + CustomColorButtonIcon.Visibility = Visibility.Visible; + } else { + CustomColorButtonColorBorder.Visibility = Visibility.Visible; + CustomColorButtonColorBorder.Background = new SolidColorBrush((Color)_customColor); + CustomColorButtonIcon.Visibility = Visibility.Collapsed; + if (_colorSelected == ColorPaletteColor.ColorCustom) + CustomColorButtonColorBorderCheckIcon.Visibility = Visibility.Visible; + else CustomColorButtonColorBorderCheckIcon.Visibility = Visibility.Collapsed; + CustomColorButtonColorBorderCheckIcon.Source = + this.FindResource(ColorUtilities.GetReverseForegroundColor(ColorUtilities.GetGrayLevel((Color)_customColor)) == Colors.White + ? "CheckedLightIcon" + : "CheckedDarkIcon") as DrawingImage; + } + } + + private void CustomColorPicker_ColorChanged(object sender, RoutedEventArgs e) { + var cp = sender as SquarePicker; + _customColor = cp.SelectedColor; + if (_colorSelected != ColorPaletteColor.ColorCustom) _colorSelected = ColorPaletteColor.ColorCustom; + UpdateCustomColorPickerDisplayStatus(); + UpdateCustomColorButtonDisplayStatus(); + UpdateColorButtonsDisplayStatus(); + } + private void ColorBtnStoryBoardScaleAnimation(object sender, double from, double to) { var border = sender as Border; @@ -403,6 +498,38 @@ namespace Ink_Canvas.Popups { public ColorPaletteColor PreviousColor { get; set; } public ColorPaletteColor NowColor { get; set; } public TriggerMode TriggerMode { get; set; } + public Color CustomColor { get; set; } + } + + public class ColorModeChangedEventArgs : EventArgs + { + public bool IsPreviousUsedDarkColor { get; set; } + public bool IsNowUsingDarkColor { get; set; } + public TriggerMode TriggerMode { get; set; } + } + + private void UpdateColorPaletteColorsAndColorModeChangeButton() { + foreach (var bd in ColorPaletteColorButtonBorders) { + bd.Background = + new SolidColorBrush((_usingDarkColors ? _darkColors : _lightColors)[ + Array.IndexOf(ColorPaletteColorStrings, bd.Name.ToLower())]); + } + + var tb = ((SimpleStackPanel)ColorModeChangeButton.Content).Children.OfType().Single(); + tb.Text = _usingDarkColors ? "亮色" : "暗色"; + } + + private void ColorModeChangeButton_Clicked(object sender, RoutedEventArgs e) { + var pre = _usingDarkColors; + _usingDarkColors = !_usingDarkColors; + UpdateColorPaletteColorsAndColorModeChangeButton(); + UpdateColorButtonsDisplayStatus(); + ColorModeChanged?.Invoke(this, new ColorModeChangedEventArgs() + { + IsPreviousUsedDarkColor = pre, + IsNowUsingDarkColor = _usingDarkColors, + TriggerMode = TriggerMode.TriggeredByUser, + }); } public class PenModeChangedEventArgs : EventArgs @@ -425,7 +552,26 @@ namespace Ink_Canvas.Popups { public bool isRecognizeTriangle; public bool isRecognizeQuadrilateral; public bool isRecognizePolygon; - public bool isFitToCurve; + } + + private Color? _customColor = null; + + private void CustomColorButton_Clicked(object sender, RoutedEventArgs e) { + if (_customColor == null) { + CustomColorPanel.Visibility = Visibility.Visible; + } else { + if (_colorSelected == ColorPaletteColor.ColorCustom) CustomColorPanel.Visibility = Visibility.Visible; + else { + _colorSelected = ColorPaletteColor.ColorCustom; + UpdateColorButtonsDisplayStatus(); + UpdateCustomColorButtonDisplayStatus(); + UpdateCustomColorPickerDisplayStatus(); + } + } + } + + private void BackToPaletteButton_Clicked(object sender, RoutedEventArgs e) { + CustomColorPanel.Visibility = Visibility.Collapsed; } public class InkRecognitionChangedEventArgs : EventArgs { @@ -439,6 +585,7 @@ namespace Ink_Canvas.Popups { public event EventHandler PenModeChanged; public event EventHandler InkRecognitionChanged; public event EventHandler PressureSimulationChanged; + public event EventHandler ColorModeChanged; public ColorPalette() { InitializeComponent(); @@ -464,6 +611,7 @@ namespace Ink_Canvas.Popups { UpdatePenModeButtonsDisplayStatus(); UpdateColorButtonsDisplayStatus(); + UpdateColorPaletteColorsAndColorModeChangeButton(); } } } \ No newline at end of file diff --git a/InkCanvasForClass/Popups/FloatingBarV2Resources.xaml b/InkCanvasForClass/Popups/FloatingBarV2Resources.xaml new file mode 100644 index 0000000..cc1bd18 --- /dev/null +++ b/InkCanvasForClass/Popups/FloatingBarV2Resources.xaml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/InkCanvasForClass/Popups/FloatingBarWindowV2.xaml b/InkCanvasForClass/Popups/FloatingBarWindowV2.xaml new file mode 100644 index 0000000..a5f0349 --- /dev/null +++ b/InkCanvasForClass/Popups/FloatingBarWindowV2.xaml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/InkCanvasForClass/Popups/FloatingBarWindowV2.xaml.cs b/InkCanvasForClass/Popups/FloatingBarWindowV2.xaml.cs new file mode 100644 index 0000000..8bf2c2d --- /dev/null +++ b/InkCanvasForClass/Popups/FloatingBarWindowV2.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace Ink_Canvas.Popups +{ + /// + /// FloatingBarWindowV2.xaml 的交互逻辑 + /// + public partial class FloatingBarWindowV2 : Window + { + public FloatingBarWindowV2() + { + InitializeComponent(); + } + } +} diff --git a/InkCanvasForClass/Properties/AssemblyInfo.cs b/InkCanvasForClass/Properties/AssemblyInfo.cs index c4d6a88..7624281 100644 --- a/InkCanvasForClass/Properties/AssemblyInfo.cs +++ b/InkCanvasForClass/Properties/AssemblyInfo.cs @@ -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.5.1")] -[assembly: AssemblyFileVersion("5.0.5.1")] \ No newline at end of file +[assembly: AssemblyVersion("6.0.0.0")] +[assembly: AssemblyFileVersion("6.0.0.0")] \ No newline at end of file diff --git a/InkCanvasForClass/Resources/Cursors/Cursor.cur b/InkCanvasForClass/Resources/Cursors/Cursor.cur deleted file mode 100644 index 95b0175..0000000 Binary files a/InkCanvasForClass/Resources/Cursors/Cursor.cur and /dev/null differ diff --git a/InkCanvasForClass/Resources/Cursors/cursor-move.cur b/InkCanvasForClass/Resources/Cursors/cursor-move.cur new file mode 100644 index 0000000..168593e Binary files /dev/null and b/InkCanvasForClass/Resources/Cursors/cursor-move.cur differ diff --git a/InkCanvasForClass/Resources/Cursors/cursor-resize-lr.cur b/InkCanvasForClass/Resources/Cursors/cursor-resize-lr.cur new file mode 100644 index 0000000..a29801b Binary files /dev/null and b/InkCanvasForClass/Resources/Cursors/cursor-resize-lr.cur differ diff --git a/InkCanvasForClass/Resources/Cursors/cursor-resize-lt-rb.cur b/InkCanvasForClass/Resources/Cursors/cursor-resize-lt-rb.cur new file mode 100644 index 0000000..01c3e19 Binary files /dev/null and b/InkCanvasForClass/Resources/Cursors/cursor-resize-lt-rb.cur differ diff --git a/InkCanvasForClass/Resources/Cursors/cursor-resize-rt-lb.cur b/InkCanvasForClass/Resources/Cursors/cursor-resize-rt-lb.cur new file mode 100644 index 0000000..a0e3126 Binary files /dev/null and b/InkCanvasForClass/Resources/Cursors/cursor-resize-rt-lb.cur differ diff --git a/InkCanvasForClass/Resources/Cursors/cursor-resize-tb.cur b/InkCanvasForClass/Resources/Cursors/cursor-resize-tb.cur new file mode 100644 index 0000000..b064995 Binary files /dev/null and b/InkCanvasForClass/Resources/Cursors/cursor-resize-tb.cur differ diff --git a/InkCanvasForClass/Resources/GeometryIcons.xaml b/InkCanvasForClass/Resources/GeometryIcons.xaml new file mode 100644 index 0000000..919eb51 --- /dev/null +++ b/InkCanvasForClass/Resources/GeometryIcons.xaml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/InkCanvasForClass/Resources/Icons-png/windows-ink.png b/InkCanvasForClass/Resources/Icons-png/windows-ink.png new file mode 100644 index 0000000..1026b33 Binary files /dev/null and b/InkCanvasForClass/Resources/Icons-png/windows-ink.png differ diff --git a/InkCanvasForClass/Resources/Settings.cs b/InkCanvasForClass/Resources/Settings.cs index 90490d7..b5b2e5f 100644 --- a/InkCanvasForClass/Resources/Settings.cs +++ b/InkCanvasForClass/Resources/Settings.cs @@ -129,6 +129,10 @@ namespace Ink_Canvas public bool EnableMouseRightBtnGesture { get; set; } = true; [JsonProperty("enableMouseWheelGesture")] public bool EnableMouseWheelGesture { get; set; } = true; + [JsonProperty("windowsInkEraserButtonAction")] + public int WindowsInkEraserButtonAction { get; set; } = 2; + [JsonProperty("windowsInkBarrelButtonAction")] + public int WindowsInkBarrelButtonAction { get; set; } = 0; } public class Startup @@ -151,6 +155,8 @@ namespace Ink_Canvas public bool IsAutoEnterModeFinger { get; set; } = false;*/ [JsonProperty("isFoldAtStartup")] public bool IsFoldAtStartup { get; set; } = false; + [JsonProperty("enableWindowChromeRendering")] + public bool EnableWindowChromeRendering { get; set; } = false; } public class Appearance @@ -252,8 +258,6 @@ namespace Ink_Canvas public bool IsNotifyAutoPlayPresentation { get; set; } = true; [JsonProperty("isEnableTwoFingerGestureInPresentationMode")] public bool IsEnableTwoFingerGestureInPresentationMode { get; set; } = false; - [JsonProperty("isEnableFingerGestureSlideShowControl")] - public bool IsEnableFingerGestureSlideShowControl { get; set; } = true; [JsonProperty("isSupportWPS")] public bool IsSupportWPS { get; set; } = true; @@ -390,6 +394,12 @@ namespace Ink_Canvas [JsonProperty("autoDelSavedFilesDaysThreshold")] public int AutoDelSavedFilesDaysThreshold = 15; + + [JsonProperty("isEnableLimitAutoSaveAmount")] + public bool IsEnableLimitAutoSaveAmount { get; set; } = false; + + [JsonProperty("limitAutoSaveAmount")] + public int LimitAutoSaveAmount { get; set; } = 3; } public class Advanced @@ -435,6 +445,8 @@ namespace Ink_Canvas [JsonProperty("isDisableCloseWindow")] public bool IsDisableCloseWindow { get; set; } = true; + [JsonProperty("enableForceTopMost")] + public bool EnableForceTopMost { get; set; } = false; } public class InkToShape diff --git a/InkCanvasForClass/Resources/Themes/DarkFloatingBarTheme.xaml b/InkCanvasForClass/Resources/Themes/DarkFloatingBarTheme.xaml new file mode 100644 index 0000000..a60cfa1 --- /dev/null +++ b/InkCanvasForClass/Resources/Themes/DarkFloatingBarTheme.xaml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file