@@ -5,15 +5,12 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using Microsoft.Win32;
|
||||
using System.Security;
|
||||
using System.Security;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using Window = System.Windows.Window;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Net;
|
||||
|
||||
@@ -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("1.7.1.6")]
|
||||
[assembly: AssemblyFileVersion("1.7.1.6")]
|
||||
[assembly: AssemblyVersion("1.7.1.10")]
|
||||
[assembly: AssemblyFileVersion("1.7.1.10")]
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Point = System.Windows.Point;
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ using System.Windows;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Controls;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
|
||||
namespace Ink_Canvas.Helpers {
|
||||
internal class DelAutoSavedFiles {
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Timers;
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
{
|
||||
@@ -23,44 +25,6 @@ namespace Ink_Canvas.Helpers
|
||||
[DllImport("user32.dll")]
|
||||
private static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
|
||||
|
||||
[DllImport("shell32.dll")]
|
||||
private static extern IntPtr SHAppBarMessage(uint dwMessage, ref APPBARDATA pData);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern int SystemParametersInfo(uint uiAction, uint uiParam, IntPtr pvParam, uint fWinIni);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool GetMonitorInfo(IntPtr hMonitor, ref MONITORINFO lpmi);
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr MonitorFromWindow(IntPtr hwnd, uint dwFlags);
|
||||
|
||||
private const uint ABM_GETTASKBARPOS = 0x00000005;
|
||||
private const uint ABM_GETSTATE = 0x00000004;
|
||||
private const int SPI_GETWORKAREA = 0x0030;
|
||||
private const uint MONITOR_DEFAULTTOPRIMARY = 1;
|
||||
private const int ABS_AUTOHIDE = 0x0000001;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct MONITORINFO
|
||||
{
|
||||
public int cbSize;
|
||||
public RECT rcMonitor;
|
||||
public RECT rcWork;
|
||||
public uint dwFlags;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct APPBARDATA
|
||||
{
|
||||
public int cbSize;
|
||||
public IntPtr hWnd;
|
||||
public uint uCallbackMessage;
|
||||
public uint uEdge;
|
||||
public RECT rc;
|
||||
public IntPtr lParam;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RECT {
|
||||
public int Left;
|
||||
@@ -72,72 +36,6 @@ namespace Ink_Canvas.Helpers
|
||||
public int Height => Bottom - Top;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取Windows任务栏的高度(仅计算任务栏,不包括其他应用的停靠栏)
|
||||
/// </summary>
|
||||
/// <param name="screen">当前屏幕</param>
|
||||
/// <param name="dpiScaleY">DPI缩放Y值</param>
|
||||
/// <returns>任务栏高度</returns>
|
||||
public static double GetTaskbarHeight(System.Windows.Forms.Screen screen, double dpiScaleY)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 创建APPBARDATA结构
|
||||
var abd = new APPBARDATA();
|
||||
abd.cbSize = Marshal.SizeOf(abd);
|
||||
|
||||
// 获取任务栏状态
|
||||
IntPtr state = SHAppBarMessage(ABM_GETSTATE, ref abd);
|
||||
bool isAutoHide = (state.ToInt32() & ABS_AUTOHIDE) == ABS_AUTOHIDE;
|
||||
|
||||
// 如果任务栏是自动隐藏的,返回0
|
||||
if (isAutoHide)
|
||||
{
|
||||
LogHelper.WriteLogToFile("任务栏处于自动隐藏状态", LogHelper.LogType.Info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 获取任务栏信息
|
||||
IntPtr result = SHAppBarMessage(ABM_GETTASKBARPOS, ref abd);
|
||||
if (result != IntPtr.Zero)
|
||||
{
|
||||
// 获取当前屏幕的工作区
|
||||
RECT workArea = new RECT();
|
||||
SystemParametersInfo(SPI_GETWORKAREA, 0, Marshal.AllocHGlobal(Marshal.SizeOf(workArea)), 0);
|
||||
|
||||
// 根据任务栏位置计算高度
|
||||
int taskbarHeight = 0;
|
||||
|
||||
// 任务栏的uEdge: 0=左, 1=上, 2=右, 3=下
|
||||
switch (abd.uEdge)
|
||||
{
|
||||
case 1: // 上
|
||||
taskbarHeight = abd.rc.Height;
|
||||
break;
|
||||
case 3: // 下
|
||||
taskbarHeight = abd.rc.Height;
|
||||
break;
|
||||
case 0: // 左
|
||||
case 2: // 右
|
||||
// 水平任务栏不影响高度
|
||||
taskbarHeight = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
// 考虑DPI缩放
|
||||
return taskbarHeight / dpiScaleY;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine($"获取任务栏高度出错: {ex.Message}");
|
||||
LogHelper.WriteLogToFile($"获取任务栏高度出错: {ex.Message}", LogHelper.LogType.Error);
|
||||
}
|
||||
|
||||
// 如果获取失败,回退到通用方法
|
||||
return (screen.Bounds.Height - screen.WorkingArea.Height) / dpiScaleY;
|
||||
}
|
||||
|
||||
public static string WindowTitle() {
|
||||
IntPtr foregroundWindowHandle = GetForegroundWindow();
|
||||
|
||||
@@ -197,5 +95,23 @@ namespace Ink_Canvas.Helpers
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetTaskbarHeight(Screen screen, double dpiScaleY)
|
||||
{
|
||||
// 优先用工作区和屏幕区的差值法,兼容多屏
|
||||
int height = 0;
|
||||
if (screen.Bounds.Height > screen.WorkingArea.Height)
|
||||
{
|
||||
// 任务栏在上下
|
||||
height = screen.Bounds.Height - screen.WorkingArea.Height;
|
||||
}
|
||||
else if (screen.Bounds.Width > screen.WorkingArea.Width)
|
||||
{
|
||||
// 任务栏在左右
|
||||
height = screen.Bounds.Width - screen.WorkingArea.Width;
|
||||
}
|
||||
// 考虑DPI缩放
|
||||
return (int)(height / dpiScaleY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
// 由衷感謝 lindexi 提供的 《WPF 稳定的全屏化窗口方法》
|
||||
// 文章鏈接:https://blog.lindexi.com/post/WPF-%E7%A8%B3%E5%AE%9A%E7%9A%84%E5%85%A8%E5%B1%8F%E5%8C%96%E7%AA%97%E5%8F%A3%E6%96%B9%E6%B3%95.html
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Helpers.Plugins
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows; // Added for UIElement
|
||||
|
||||
namespace Ink_Canvas.Helpers
|
||||
{
|
||||
public class TimeMachine
|
||||
public partial class TimeMachine
|
||||
{
|
||||
private readonly List<TimeMachineHistory> _currentStrokeHistory = new List<TimeMachineHistory>();
|
||||
|
||||
@@ -139,6 +139,7 @@ namespace Ink_Canvas.Helpers
|
||||
//这里说一下 Tuple的 Value1 是初始值 ; Value 2 是改变值
|
||||
public Dictionary<Stroke, Tuple<StylusPointCollection, StylusPointCollection>> StylusPointDictionary;
|
||||
public Dictionary<Stroke, Tuple<DrawingAttributes, DrawingAttributes>> DrawingAttributes;
|
||||
public UIElement InsertedElement; // 新增
|
||||
public TimeMachineHistory(StrokeCollection currentStroke, TimeMachineHistoryType commitType, bool strokeHasBeenCleared)
|
||||
{
|
||||
CommitType = commitType;
|
||||
@@ -163,6 +164,11 @@ namespace Ink_Canvas.Helpers
|
||||
StrokeHasBeenCleared = strokeHasBeenCleared;
|
||||
ReplacedStroke = replacedStroke;
|
||||
}
|
||||
public TimeMachineHistory(UIElement element, TimeMachineHistoryType commitType) // 新增
|
||||
{
|
||||
CommitType = commitType;
|
||||
InsertedElement = element;
|
||||
}
|
||||
}
|
||||
|
||||
public enum TimeMachineHistoryType
|
||||
@@ -171,6 +177,21 @@ namespace Ink_Canvas.Helpers
|
||||
ShapeRecognition,
|
||||
Clear,
|
||||
Manipulation,
|
||||
DrawingAttributes
|
||||
DrawingAttributes,
|
||||
ElementInsert // 新增
|
||||
}
|
||||
|
||||
public partial class TimeMachine // 新增partial,便于扩展
|
||||
{
|
||||
public void CommitElementInsertHistory(UIElement element)
|
||||
{
|
||||
if (_currentIndex + 1 < _currentStrokeHistory.Count)
|
||||
{
|
||||
_currentStrokeHistory.RemoveRange(_currentIndex + 1, (_currentStrokeHistory.Count - 1) - _currentIndex);
|
||||
}
|
||||
_currentStrokeHistory.Add(new TimeMachineHistory(element, TimeMachineHistoryType.ElementInsert));
|
||||
_currentIndex = _currentStrokeHistory.Count - 1;
|
||||
NotifyUndoRedoState();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="White"
|
||||
Geometry="M4 24V12H13V10C13 6.68629 15.6863 4 19 4C22.3137 4 25 6.68629 25 10V12H34V24H38C41.3137 24 44 26.6863 44 30C44 33.3137 41.3137 36 38 36H34V44H4V36H8C11.3137 36 14 33.3137 14 30C14 26.6863 11.3137 24 8 24H4Z"/>
|
||||
Geometry="M342.826667 213.333333a149.333333 149.333333 0 0 1 295.68 0H682.666667a128 128 0 0 1 128 128v44.16a149.333333 149.333333 0 0 1 0 295.68V725.333333a128 128 0 0 1-128 128h-128v-21.333333a64 64 0 0 0-128 0v21.333333H298.666667a128 128 0 0 1-128-128v-128h21.333333a64 64 0 0 0 0-128H170.666667V341.333333a128 128 0 0 1 128-128h44.16zM426.666667 234.666667V298.666667H298.666667q-17.664 0-30.165334 12.501333T256 341.333333v56.576q22.528 10.752 41.6 29.866667Q341.333333 471.466667 341.333333 533.333333q0 61.866667-43.733333 105.6-19.072 19.072-41.6 29.824V725.333333q0 17.664 12.501333 30.165334T298.666667 768h56.576q10.752-22.528 29.866666-41.6Q428.8 682.666667 490.666667 682.666667q61.866667 0 105.6 43.733333 19.072 19.072 29.824 41.6H682.666667q17.664 0 30.165333-12.501333T725.333333 725.333333v-128h64a64 64 0 0 0 0-128H725.333333V341.333333q0-17.664-12.501333-30.165333T682.666667 298.666667h-128V234.666667a64 64 0 1 0-128 0z"/>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
@@ -765,6 +765,12 @@
|
||||
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchClearCanvasAndClearTimeMachine_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="插入图片时自动压缩(大于1920x1080)" VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
|
||||
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchCompressPicturesUploaded"
|
||||
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchCompressPicturesUploaded_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0" Stroke="#3f3f46"
|
||||
StrokeThickness="1" Margin="0,4,0,4" />
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
@@ -1578,6 +1584,14 @@
|
||||
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchNotifyPreviousPage_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="进入放映时回到首页" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ui:ToggleSwitch OnContent="" OffContent=""
|
||||
Name="ToggleSwitchAlwaysGoToFirstPageOnReenter" IsOn="False"
|
||||
FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchAlwaysGoToFirstPageOnReenter_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="提示隐藏幻灯片" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
@@ -1598,7 +1612,7 @@
|
||||
</GroupBox>
|
||||
<GroupBox>
|
||||
<GroupBox.Header>
|
||||
<TextBlock Margin="0,12,0,0" Text="高级项" FontWeight="Bold" Foreground="#fafafa"
|
||||
<TextBlock Margin="0,12,0,0" Text="高级设置" FontWeight="Bold" Foreground="#fafafa"
|
||||
FontSize="26" />
|
||||
</GroupBox.Header>
|
||||
<ui:SimpleStackPanel Spacing="6">
|
||||
@@ -2248,6 +2262,15 @@
|
||||
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchAutoKillHiteAnnotation_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="鸿合屏幕书写查杀后自动进入批注" VerticalAlignment="Center"
|
||||
FontSize="14" Margin="0,0,16,0" />
|
||||
<ui:ToggleSwitch OnContent="" OffContent=""
|
||||
Name="ToggleSwitchAutoEnterAnnotationAfterKillHite"
|
||||
IsOn="False" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchAutoEnterAnnotationAfterKillHite_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<Image Source="/Resources/Icons-png/VComYouJiao.png" Margin="0,0,6,0"
|
||||
Width="28"
|
||||
@@ -2440,8 +2463,16 @@
|
||||
IsOn="False" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchAutoEnterAnnotationModeWhenExitFoldMode_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<TextBlock Text="# 开启后,退出收纳模式时将自动切换至批注模式,便于快速批注" TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<TextBlock Foreground="#fafafa" Text="退出PPT放映后自动恢复浮动栏状态"
|
||||
VerticalAlignment="Center" FontSize="14" Margin="0,0,16,0" />
|
||||
<ui:ToggleSwitch OnContent="" OffContent=""
|
||||
Name="ToggleSwitchAutoFoldAfterPPTSlideShow"
|
||||
IsOn="False" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
|
||||
Toggled="ToggleSwitchAutoFoldAfterPPTSlideShow_Toggled" />
|
||||
</ui:SimpleStackPanel>
|
||||
<TextBlock Text="# 开启后,如果进入PPT放映前为收纳模式则退出后也为收纳模式,如果进入前不是收纳模式则退出后也不是收纳模式" TextWrapping="Wrap" Foreground="#a1a1aa" />
|
||||
</ui:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Name="GroupBoxRandWindow">
|
||||
@@ -3155,7 +3186,9 @@
|
||||
<ui:ScrollViewerEx Name="BlackBoardLeftSidePageListScrollViewer"
|
||||
Height="460"
|
||||
VerticalScrollBarVisibility="Hidden"
|
||||
ForceUseSmoothScroll="True">
|
||||
ForceUseSmoothScroll="True"
|
||||
PanningMode="VerticalOnly"
|
||||
IsManipulationEnabled="True">
|
||||
<ListView ScrollViewer.CanContentScroll="False" SelectionMode="Single"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
@@ -4778,6 +4811,29 @@
|
||||
</Viewbox>
|
||||
</Border>
|
||||
</Border>
|
||||
<Border x:Name="BoardInsertImage" Width="60" Height="50" MouseDown="Border_MouseDown"
|
||||
MouseUp="InsertImage_MouseUp" BorderThickness="0,1,0,1"
|
||||
BorderBrush="#a1a1aa"
|
||||
Background="#f4f4f5"
|
||||
Opacity="0.95">
|
||||
<Grid Margin="6,6,6,4">
|
||||
<Image VerticalAlignment="Top"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="20" Width="20">
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||
<GeometryDrawing Brush="#18181b"
|
||||
Geometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z"/>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
</Image>
|
||||
<TextBlock Text="插入图片" Foreground="Black" VerticalAlignment="Bottom"
|
||||
HorizontalAlignment="Center" FontSize="12" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<Border x:Name="BoardUndo" Width="60" Height="50" MouseDown="Border_MouseDown"
|
||||
MouseUp="SymbolIconUndo_MouseUp" BorderThickness="0,1,0,1"
|
||||
BorderBrush="#a1a1aa"
|
||||
@@ -5193,7 +5249,9 @@
|
||||
<ui:ScrollViewerEx Name="BlackBoardRightSidePageListScrollViewer"
|
||||
Height="460"
|
||||
VerticalScrollBarVisibility="Hidden"
|
||||
ForceUseSmoothScroll="True">
|
||||
ForceUseSmoothScroll="True"
|
||||
PanningMode="VerticalOnly"
|
||||
IsManipulationEnabled="True">
|
||||
<ListView ScrollViewer.CanContentScroll="False" SelectionMode="Single"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
@@ -7808,6 +7866,16 @@
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
|
||||
<TextBlock Text="白板" Foreground="Black" FontSize="8" Margin="0,2,0,3" TextAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel
|
||||
x:Name="BtnExitPptFromSidebarLeft"
|
||||
MouseUp="ExitPPTSlideShow_MouseUp"
|
||||
Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center"
|
||||
Width="32" Margin="0" Visibility="Collapsed">
|
||||
<Image Source="/Resources/new-icons/end-slides-show.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
|
||||
<TextBlock Text="退出放映" Foreground="Black" FontSize="8" Margin="0,2,0,3" TextAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<ui:SimpleStackPanel
|
||||
MouseUp="UnFoldFloatingBar_MouseUp"
|
||||
Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center"
|
||||
@@ -7881,6 +7949,16 @@
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
|
||||
<TextBlock Text="白板" Foreground="Black" FontSize="8" Margin="0,2,0,3" TextAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
<ui:SimpleStackPanel
|
||||
x:Name="BtnExitPptFromSidebarRight"
|
||||
MouseUp="ExitPPTSlideShow_MouseUp"
|
||||
Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center"
|
||||
Width="32" Margin="0" Visibility="Collapsed">
|
||||
<Image Source="/Resources/new-icons/end-slides-show.png"
|
||||
RenderOptions.BitmapScalingMode="HighQuality" Height="17" Margin="0,3,0,0" />
|
||||
<TextBlock Text="退出放映" Foreground="Black" FontSize="8" Margin="0,2,0,3" TextAlignment="Center" />
|
||||
</ui:SimpleStackPanel>
|
||||
|
||||
<ui:SimpleStackPanel
|
||||
MouseUp="UnFoldFloatingBar_MouseUp"
|
||||
Background="Transparent" Orientation="Vertical" HorizontalAlignment="Center"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using iNKORE.UI.WPF.Modern;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -12,15 +11,10 @@ using File = System.IO.File;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Win32;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Reflection;
|
||||
using Brushes = System.Windows.Media.Brushes;
|
||||
using Point = System.Windows.Point;
|
||||
@@ -41,6 +35,20 @@ namespace Ink_Canvas {
|
||||
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
||||
private const int GWL_EXSTYLE = -20;
|
||||
private const int WS_EX_NOACTIVATE = 0x08000000;
|
||||
|
||||
// 新增:设置窗口置顶并兼容无焦点
|
||||
private void SetTopmostWithNoActivate(bool topmost)
|
||||
{
|
||||
var hwnd = new WindowInteropHelper(this).Handle;
|
||||
int exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
// 先移除 WS_EX_NOACTIVATE
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, exStyle & ~WS_EX_NOACTIVATE);
|
||||
// 设置 Topmost
|
||||
this.Topmost = topmost;
|
||||
// 再加回 WS_EX_NOACTIVATE
|
||||
exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, exStyle | WS_EX_NOACTIVATE);
|
||||
}
|
||||
|
||||
#region Window Initialization
|
||||
|
||||
@@ -131,15 +139,61 @@ namespace Ink_Canvas {
|
||||
InkCanvasGridForInkReplay.Children.Add(firstCanvas);
|
||||
currentPageIndex = 0;
|
||||
ShowPage(currentPageIndex);
|
||||
|
||||
// 手动实现触摸滑动
|
||||
double leftTouchStartY = 0;
|
||||
double leftScrollStartOffset = 0;
|
||||
bool leftIsTouching = false;
|
||||
BlackBoardLeftSidePageListScrollViewer.TouchDown += (s, e) => {
|
||||
leftIsTouching = true;
|
||||
leftTouchStartY = e.GetTouchPoint(BlackBoardLeftSidePageListScrollViewer).Position.Y;
|
||||
leftScrollStartOffset = BlackBoardLeftSidePageListScrollViewer.VerticalOffset;
|
||||
BlackBoardLeftSidePageListScrollViewer.CaptureTouch(e.TouchDevice);
|
||||
e.Handled = true;
|
||||
};
|
||||
BlackBoardLeftSidePageListScrollViewer.TouchMove += (s, e) => {
|
||||
if (leftIsTouching) {
|
||||
double currentY = e.GetTouchPoint(BlackBoardLeftSidePageListScrollViewer).Position.Y;
|
||||
double delta = leftTouchStartY - currentY;
|
||||
BlackBoardLeftSidePageListScrollViewer.ScrollToVerticalOffset(leftScrollStartOffset + delta);
|
||||
e.Handled = true;
|
||||
}
|
||||
};
|
||||
BlackBoardLeftSidePageListScrollViewer.TouchUp += (s, e) => {
|
||||
leftIsTouching = false;
|
||||
BlackBoardLeftSidePageListScrollViewer.ReleaseTouchCapture(e.TouchDevice);
|
||||
e.Handled = true;
|
||||
};
|
||||
double rightTouchStartY = 0;
|
||||
double rightScrollStartOffset = 0;
|
||||
bool rightIsTouching = false;
|
||||
BlackBoardRightSidePageListScrollViewer.TouchDown += (s, e) => {
|
||||
rightIsTouching = true;
|
||||
rightTouchStartY = e.GetTouchPoint(BlackBoardRightSidePageListScrollViewer).Position.Y;
|
||||
rightScrollStartOffset = BlackBoardRightSidePageListScrollViewer.VerticalOffset;
|
||||
BlackBoardRightSidePageListScrollViewer.CaptureTouch(e.TouchDevice);
|
||||
e.Handled = true;
|
||||
};
|
||||
BlackBoardRightSidePageListScrollViewer.TouchMove += (s, e) => {
|
||||
if (rightIsTouching) {
|
||||
double currentY = e.GetTouchPoint(BlackBoardRightSidePageListScrollViewer).Position.Y;
|
||||
double delta = rightTouchStartY - currentY;
|
||||
BlackBoardRightSidePageListScrollViewer.ScrollToVerticalOffset(rightScrollStartOffset + delta);
|
||||
e.Handled = true;
|
||||
}
|
||||
};
|
||||
BlackBoardRightSidePageListScrollViewer.TouchUp += (s, e) => {
|
||||
rightIsTouching = false;
|
||||
BlackBoardRightSidePageListScrollViewer.ReleaseTouchCapture(e.TouchDevice);
|
||||
e.Handled = true;
|
||||
};
|
||||
}
|
||||
|
||||
protected override void OnSourceInitialized(EventArgs e)
|
||||
{
|
||||
base.OnSourceInitialized(e);
|
||||
// 设置窗口为无焦点(不会抢占焦点)
|
||||
var hwnd = new WindowInteropHelper(this).Handle;
|
||||
int exStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
SetWindowLong(hwnd, GWL_EXSTYLE, exStyle | WS_EX_NOACTIVATE);
|
||||
// 设置窗口为无焦点且置顶(不会抢占焦点且始终在最前)
|
||||
SetTopmostWithNoActivate(true);
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1252,5 +1306,11 @@ namespace Ink_Canvas {
|
||||
currentPageIndex = whiteboardPages.Count - 1;
|
||||
ShowPage(currentPageIndex);
|
||||
}
|
||||
// 快速面板退出PPT放映按钮事件
|
||||
private void ExitPPTSlideShow_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
// 直接调用PPT放映结束按钮的逻辑
|
||||
BtnPPTSlideShowEnd_Click(BtnPPTSlideShowEnd, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using iNKORE.UI.WPF.Modern;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -9,7 +8,6 @@ using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
@@ -40,7 +38,7 @@ namespace Ink_Canvas {
|
||||
await FoldFloatingBar(sender);
|
||||
}
|
||||
|
||||
public async Task FoldFloatingBar(object sender)
|
||||
public async Task FoldFloatingBar(object sender, bool isAutoFoldCommand = false)
|
||||
{
|
||||
var isShouldRejectAction = false;
|
||||
|
||||
@@ -84,7 +82,7 @@ namespace Ink_Canvas {
|
||||
CursorWithDelIcon_Click(sender, null);
|
||||
});
|
||||
|
||||
await Task.Delay(10);
|
||||
await Task.Delay(300);
|
||||
|
||||
await Dispatcher.InvokeAsync(() => {
|
||||
LeftBottomPanelForPPTNavigation.Visibility = Visibility.Collapsed;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using IWshRuntimeLibrary;
|
||||
using System;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using IWshRuntimeLibrary;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Xml.Linq;
|
||||
using System.Windows.Controls;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
@@ -23,6 +22,7 @@ namespace Ink_Canvas {
|
||||
private int WhiteboardTotalCount = 1;
|
||||
private TimeMachineHistory[][] TimeMachineHistories = new TimeMachineHistory[101][]; //最多99页,0用来存储非白板时的墨迹以便还原
|
||||
|
||||
// 保存每页白板图片信息
|
||||
private void SaveStrokes(bool isBackupMain = false) {
|
||||
if (isBackupMain) {
|
||||
var timeMachineHistory = timeMachine.ExportTimeMachineHistory();
|
||||
@@ -32,6 +32,26 @@ namespace Ink_Canvas {
|
||||
var timeMachineHistory = timeMachine.ExportTimeMachineHistory();
|
||||
TimeMachineHistories[CurrentWhiteboardIndex] = timeMachineHistory;
|
||||
timeMachine.ClearStrokeHistory();
|
||||
// 保存当前页图片信息
|
||||
var elementInfos = new List<CanvasElementInfo>();
|
||||
foreach (var child in inkCanvas.Children)
|
||||
{
|
||||
if (child is Image img && img.Source is BitmapImage bmp)
|
||||
{
|
||||
elementInfos.Add(new CanvasElementInfo
|
||||
{
|
||||
Type = "Image",
|
||||
SourcePath = bmp.UriSource?.LocalPath ?? "",
|
||||
Left = InkCanvas.GetLeft(img),
|
||||
Top = InkCanvas.GetTop(img),
|
||||
Width = img.Width,
|
||||
Height = img.Height
|
||||
});
|
||||
}
|
||||
}
|
||||
var savePath = Settings.Automation.AutoSavedStrokesLocation;
|
||||
if (!Directory.Exists(savePath)) Directory.CreateDirectory(savePath);
|
||||
File.WriteAllText(System.IO.Path.Combine(savePath, $"elements_page{CurrentWhiteboardIndex}.json"), JsonConvert.SerializeObject(elementInfos, Formatting.Indented));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +62,7 @@ namespace Ink_Canvas {
|
||||
_currentCommitType = CommitReason.UserInput;
|
||||
}
|
||||
|
||||
// 恢复每页白板图片信息
|
||||
private void RestoreStrokes(bool isBackupMain = false) {
|
||||
try {
|
||||
if (TimeMachineHistories[CurrentWhiteboardIndex] == null) return; //防止白板打开后不居中
|
||||
@@ -51,6 +72,29 @@ namespace Ink_Canvas {
|
||||
} else {
|
||||
timeMachine.ImportTimeMachineHistory(TimeMachineHistories[CurrentWhiteboardIndex]);
|
||||
foreach (var item in TimeMachineHistories[CurrentWhiteboardIndex]) ApplyHistoryToCanvas(item);
|
||||
// 恢复当前页图片信息
|
||||
inkCanvas.Children.Clear();
|
||||
var savePath = Settings.Automation.AutoSavedStrokesLocation;
|
||||
var elementsFile = System.IO.Path.Combine(savePath, $"elements_page{CurrentWhiteboardIndex}.json");
|
||||
if (File.Exists(elementsFile))
|
||||
{
|
||||
var elementInfos = JsonConvert.DeserializeObject<List<CanvasElementInfo>>(File.ReadAllText(elementsFile));
|
||||
foreach (var info in elementInfos)
|
||||
{
|
||||
if (info.Type == "Image" && File.Exists(info.SourcePath))
|
||||
{
|
||||
var img = new Image
|
||||
{
|
||||
Source = new BitmapImage(new Uri(info.SourcePath)),
|
||||
Width = info.Width,
|
||||
Height = info.Height
|
||||
};
|
||||
InkCanvas.SetLeft(img, info.Left);
|
||||
InkCanvas.SetTop(img, info.Top);
|
||||
inkCanvas.Children.Add(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
|
||||
@@ -6,8 +6,6 @@ using System.Windows.Controls;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Ink;
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
#region Image
|
||||
private async void BtnImageInsert_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Filter = "Image files (*.jpg; *.jpeg; *.png; *.bmp)|*.jpg;*.jpeg;*.png;*.bmp";
|
||||
|
||||
if (openFileDialog.ShowDialog() == true)
|
||||
{
|
||||
string filePath = openFileDialog.FileName;
|
||||
|
||||
Image image = await CreateAndCompressImageAsync(filePath);
|
||||
|
||||
if (image != null)
|
||||
{
|
||||
string timestamp = "img_" + DateTime.Now.ToString("yyyyMMdd_HH_mm_ss_fff");
|
||||
image.Name = timestamp;
|
||||
|
||||
// 新缩放逻辑:最大宽高为画布一半,并居中
|
||||
double maxWidth = inkCanvas.ActualWidth / 2;
|
||||
double maxHeight = inkCanvas.ActualHeight / 2;
|
||||
double scaleX = maxWidth / image.Width;
|
||||
double scaleY = maxHeight / image.Height;
|
||||
double scale = Math.Min(1, Math.Min(scaleX, scaleY));
|
||||
image.Width = image.Width * scale;
|
||||
image.Height = image.Height * scale;
|
||||
InkCanvas.SetLeft(image, (inkCanvas.ActualWidth - image.Width) / 2);
|
||||
InkCanvas.SetTop(image, (inkCanvas.ActualHeight - image.Height) / 2);
|
||||
|
||||
inkCanvas.Children.Add(image);
|
||||
|
||||
timeMachine.CommitElementInsertHistory(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<Image> CreateAndCompressImageAsync(string filePath)
|
||||
{
|
||||
string savePath = Path.Combine(Settings.Automation.AutoSavedStrokesLocation, "File Dependency");
|
||||
if (!Directory.Exists(savePath))
|
||||
{
|
||||
Directory.CreateDirectory(savePath);
|
||||
}
|
||||
|
||||
string fileExtension = Path.GetExtension(filePath);
|
||||
string timestamp = "img_" + DateTime.Now.ToString("yyyyMMdd_HH_mm_ss_fff");
|
||||
string newFilePath = Path.Combine(savePath, timestamp + fileExtension);
|
||||
|
||||
await Task.Run(() => File.Copy(filePath, newFilePath, true));
|
||||
|
||||
return await Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
BitmapImage bitmapImage = new BitmapImage();
|
||||
bitmapImage.BeginInit();
|
||||
bitmapImage.UriSource = new Uri(newFilePath);
|
||||
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
|
||||
bitmapImage.EndInit();
|
||||
|
||||
int width = bitmapImage.PixelWidth;
|
||||
int height = bitmapImage.PixelHeight;
|
||||
|
||||
Image image = new Image();
|
||||
if (isLoaded && Settings.Canvas.IsCompressPicturesUploaded && (width > 1920 || height > 1080))
|
||||
{
|
||||
double scaleX = 1920.0 / width;
|
||||
double scaleY = 1080.0 / height;
|
||||
double scale = Math.Min(scaleX, scaleY);
|
||||
|
||||
TransformedBitmap transformedBitmap = new TransformedBitmap(bitmapImage, new ScaleTransform(scale, scale));
|
||||
|
||||
image.Source = transformedBitmap;
|
||||
image.Width = transformedBitmap.PixelWidth;
|
||||
image.Height = transformedBitmap.PixelHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
image.Source = bitmapImage;
|
||||
image.Width = width;
|
||||
image.Height = height;
|
||||
}
|
||||
|
||||
return image;
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Media
|
||||
private async void BtnMediaInsert_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
openFileDialog.Filter = "Media files (*.mp4; *.avi; *.wmv)|*.mp4;*.avi;*.wmv";
|
||||
|
||||
if (openFileDialog.ShowDialog() == true)
|
||||
{
|
||||
string filePath = openFileDialog.FileName;
|
||||
|
||||
byte[] mediaBytes = await Task.Run(() => File.ReadAllBytes(filePath));
|
||||
|
||||
MediaElement mediaElement = await CreateMediaElementAsync(filePath);
|
||||
|
||||
if (mediaElement != null)
|
||||
{
|
||||
InkCanvas.SetLeft(mediaElement, 0);
|
||||
InkCanvas.SetTop(mediaElement, 0);
|
||||
inkCanvas.Children.Add(mediaElement);
|
||||
|
||||
mediaElement.LoadedBehavior = MediaState.Manual;
|
||||
mediaElement.UnloadedBehavior = MediaState.Manual;
|
||||
mediaElement.Loaded += async (_, args) =>
|
||||
{
|
||||
mediaElement.Play();
|
||||
await Task.Delay(100);
|
||||
mediaElement.Pause();
|
||||
};
|
||||
|
||||
timeMachine.CommitElementInsertHistory(mediaElement);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<MediaElement> CreateMediaElementAsync(string filePath)
|
||||
{
|
||||
string savePath = Path.Combine(Settings.Automation.AutoSavedStrokesLocation, "File Dependency");
|
||||
if (!Directory.Exists(savePath))
|
||||
{
|
||||
Directory.CreateDirectory(savePath);
|
||||
}
|
||||
return await Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
MediaElement mediaElement = new MediaElement();
|
||||
mediaElement.Source = new Uri(filePath);
|
||||
string timestamp = "media_" + DateTime.Now.ToString("yyyyMMdd_HH_mm_ss_fff");
|
||||
mediaElement.Name = timestamp;
|
||||
mediaElement.LoadedBehavior = MediaState.Manual;
|
||||
mediaElement.UnloadedBehavior = MediaState.Manual;
|
||||
|
||||
mediaElement.Width = 256;
|
||||
mediaElement.Height = 256;
|
||||
|
||||
string fileExtension = Path.GetExtension(filePath);
|
||||
string newFilePath = Path.Combine(savePath, mediaElement.Name + fileExtension);
|
||||
|
||||
File.Copy(filePath, newFilePath, true);
|
||||
|
||||
mediaElement.Source = new Uri(newFilePath);
|
||||
|
||||
return mediaElement;
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,6 @@ using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Ink_Canvas.Helpers;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
|
||||
@@ -15,14 +15,8 @@ using System.Threading;
|
||||
using Application = System.Windows.Application;
|
||||
using Point = System.Windows.Point;
|
||||
using System.Diagnostics;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using System.IO;
|
||||
using System.Windows.Media.Effects;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
using System.Windows.Data;
|
||||
using System.Xml.Linq;
|
||||
using Image = System.Windows.Controls.Image;
|
||||
using MessageBox = iNKORE.UI.WPF.Modern.Controls.MessageBox;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
@@ -1433,6 +1427,10 @@ namespace Ink_Canvas {
|
||||
}
|
||||
}
|
||||
else {
|
||||
// 切换到批注模式时,确保保存当前图片信息
|
||||
if (currentMode != 0) {
|
||||
SaveStrokes();
|
||||
}
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
ColorSwitchCheck();
|
||||
HideSubPanels("pen", true);
|
||||
@@ -1454,9 +1452,14 @@ namespace Ink_Canvas {
|
||||
isLastTouchEraser = false;
|
||||
drawingShapeMode = 0;
|
||||
|
||||
// 切换到橡皮擦模式时,确保保存当前图片信息
|
||||
if (!isAlreadyEraser && currentMode != 0) {
|
||||
SaveStrokes();
|
||||
}
|
||||
|
||||
// 启用新的高级橡皮擦系统
|
||||
EnableAdvancedEraserSystem();
|
||||
|
||||
|
||||
// 使用新的高级橡皮擦系统
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
ApplyAdvancedEraserShape(); // 使用新的橡皮擦形状应用方法
|
||||
@@ -1765,6 +1768,9 @@ namespace Ink_Canvas {
|
||||
ClearStrokes(true);
|
||||
RestoreStrokes();
|
||||
|
||||
// 退出白板时清空图片
|
||||
inkCanvas.Children.Clear();
|
||||
|
||||
if (BtnSwitchTheme.Content.ToString() == "浅色") {
|
||||
BtnSwitch.Content = "黑板";
|
||||
BtnExit.Foreground = Brushes.White;
|
||||
@@ -1773,12 +1779,10 @@ namespace Ink_Canvas {
|
||||
BtnSwitch.Content = "白板";
|
||||
if (isPresentationHaveBlackSpace) {
|
||||
BtnExit.Foreground = Brushes.White;
|
||||
//SymbolIconBtnColorBlackContent.Foreground = Brushes.White;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
|
||||
}
|
||||
else {
|
||||
BtnExit.Foreground = Brushes.Black;
|
||||
//SymbolIconBtnColorBlackContent.Foreground = Brushes.White;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
|
||||
}
|
||||
}
|
||||
@@ -1802,22 +1806,22 @@ namespace Ink_Canvas {
|
||||
ClearStrokes(true);
|
||||
RestoreStrokes(true);
|
||||
|
||||
// 退出白板时清空图片
|
||||
inkCanvas.Children.Clear();
|
||||
|
||||
if (BtnSwitchTheme.Content.ToString() == "浅色") {
|
||||
BtnSwitch.Content = "黑板";
|
||||
BtnExit.Foreground = Brushes.White;
|
||||
//SymbolIconBtnColorBlackContent.Foreground = Brushes.Black;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
|
||||
}
|
||||
else {
|
||||
BtnSwitch.Content = "白板";
|
||||
if (isPresentationHaveBlackSpace) {
|
||||
BtnExit.Foreground = Brushes.White;
|
||||
//SymbolIconBtnColorBlackContent.Foreground = Brushes.White;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
|
||||
}
|
||||
else {
|
||||
BtnExit.Foreground = Brushes.Black;
|
||||
//SymbolIconBtnColorBlackContent.Foreground = Brushes.White;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
|
||||
}
|
||||
}
|
||||
@@ -1839,12 +1843,10 @@ namespace Ink_Canvas {
|
||||
BtnSwitch.Content = "屏幕";
|
||||
if (BtnSwitchTheme.Content.ToString() == "浅色") {
|
||||
BtnExit.Foreground = Brushes.White;
|
||||
//SymbolIconBtnColorBlackContent.Foreground = Brushes.Black;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
|
||||
}
|
||||
else {
|
||||
BtnExit.Foreground = Brushes.Black;
|
||||
//SymbolIconBtnColorBlackContent.Foreground = Brushes.White;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
|
||||
}
|
||||
|
||||
@@ -1989,7 +1991,37 @@ namespace Ink_Canvas {
|
||||
|
||||
#endregion
|
||||
|
||||
private async void InsertImage_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var dialog = new Microsoft.Win32.OpenFileDialog
|
||||
{
|
||||
Filter = "图片文件|*.jpg;*.jpeg;*.png;*.bmp;*.gif"
|
||||
};
|
||||
if (dialog.ShowDialog() == true)
|
||||
{
|
||||
string filePath = dialog.FileName;
|
||||
Image image = await CreateAndCompressImageAsync(filePath); // 补充image定义
|
||||
if (image != null)
|
||||
{
|
||||
string timestamp = "img_" + DateTime.Now.ToString("yyyyMMdd_HH_mm_ss_fff");
|
||||
image.Name = timestamp;
|
||||
|
||||
|
||||
// 新缩放逻辑:最大宽高为画布一半,并居中
|
||||
double maxWidth = inkCanvas.ActualWidth / 2;
|
||||
double maxHeight = inkCanvas.ActualHeight / 2;
|
||||
double scaleX = maxWidth / image.Width;
|
||||
double scaleY = maxHeight / image.Height;
|
||||
double scale = Math.Min(1, Math.Min(scaleX, scaleY));
|
||||
image.Width = image.Width * scale;
|
||||
image.Height = image.Height * scale;
|
||||
InkCanvas.SetLeft(image, (inkCanvas.ActualWidth - image.Width) / 2);
|
||||
InkCanvas.SetTop(image, (inkCanvas.ActualHeight - image.Height) / 2);
|
||||
|
||||
inkCanvas.Children.Add(image);
|
||||
|
||||
timeMachine.CommitElementInsertHistory(image);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
namespace Ink_Canvas {
|
||||
public static class XamlGraphicsIconGeometries {
|
||||
public static string LinedCursorIcon =
|
||||
"F1 M24,24z M0,0z M5.72106,15.9716L3.71327,3.00395C3.6389,2.6693 3.65747,2.41831 3.76902,2.25099 3.88057,2.08366 4.0479,2 4.271,2 4.4941,2 4.71711,2.07437 4.94021,2.2231 6.72502,3.39438 9.28149,5.10481 12.6094,7.3544 15.677,9.45526 18.1125,11.1285 19.9159,12.3742 20.1204,12.5229 20.2505,12.6995 20.3062,12.904 20.362,13.1085 20.3249,13.2944 20.1947,13.4618 20.0832,13.6105 19.8973,13.6849 19.637,13.6849L13.3902,13.6849 17.6291,19.7365C17.722,19.8666 17.75,20.0153 17.7128,20.1827 17.6942,20.3314 17.6198,20.4522 17.4897,20.5452L15.5654,21.8838C15.4353,21.9768 15.2865,22.0139 15.1192,21.9953 14.9704,21.9582 14.8496,21.8745 14.7566,21.7444L10.2389,15.2745 7.58956,19.9038C7.45942,20.1269 7.30144,20.2756 7.11552,20.35 6.92961,20.4058 6.75292,20.3872 6.5856,20.2942 6.43686,20.2013 6.34392,20.0339 6.30673,19.7922L6.00007,17.8959C5.88852,17.0779,5.79543,16.4364,5.72106,15.9716z";
|
||||
|
||||
+876
-267
File diff suppressed because it is too large
Load Diff
@@ -1,17 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Ink_Canvas.Helpers;
|
||||
|
||||
namespace Ink_Canvas
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Windows;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using File = System.IO.File;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Forms;
|
||||
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Controls;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
// 1. 定义元素信息结构
|
||||
public class CanvasElementInfo
|
||||
{
|
||||
public string Type { get; set; } // "Image"
|
||||
public string SourcePath { get; set; }
|
||||
public double Left { get; set; }
|
||||
public double Top { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
}
|
||||
public partial class MainWindow : Window {
|
||||
private void SymbolIconSaveStrokes_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||
if (lastBorderMouseDownObject != sender || inkCanvas.Visibility != Visibility.Visible) return;
|
||||
@@ -108,6 +116,24 @@ namespace Ink_Canvas {
|
||||
var fs = new FileStream(savePathWithName, FileMode.Create);
|
||||
inkCanvas.Strokes.Save(fs);
|
||||
fs.Close();
|
||||
// 保存元素信息
|
||||
var elementInfos = new List<CanvasElementInfo>();
|
||||
foreach (var child in inkCanvas.Children)
|
||||
{
|
||||
if (child is Image img && img.Source is BitmapImage bmp)
|
||||
{
|
||||
elementInfos.Add(new CanvasElementInfo
|
||||
{
|
||||
Type = "Image",
|
||||
SourcePath = bmp.UriSource?.LocalPath ?? "",
|
||||
Left = InkCanvas.GetLeft(img),
|
||||
Top = InkCanvas.GetTop(img),
|
||||
Width = img.Width,
|
||||
Height = img.Height
|
||||
});
|
||||
}
|
||||
}
|
||||
File.WriteAllText(Path.ChangeExtension(savePathWithName, ".elements.json"), JsonConvert.SerializeObject(elementInfos, Formatting.Indented));
|
||||
if (newNotice) ShowNotification("墨迹成功保存至 " + savePathWithName);
|
||||
}
|
||||
}
|
||||
@@ -573,6 +599,28 @@ namespace Ink_Canvas {
|
||||
}
|
||||
}
|
||||
|
||||
// 恢复元素信息
|
||||
var elementsFile = Path.ChangeExtension(filePath, ".elements.json");
|
||||
if (File.Exists(elementsFile))
|
||||
{
|
||||
var elementInfos = JsonConvert.DeserializeObject<List<CanvasElementInfo>>(File.ReadAllText(elementsFile));
|
||||
foreach (var info in elementInfos)
|
||||
{
|
||||
if (info.Type == "Image" && File.Exists(info.SourcePath))
|
||||
{
|
||||
var img = new Image
|
||||
{
|
||||
Source = new BitmapImage(new Uri(info.SourcePath)),
|
||||
Width = info.Width,
|
||||
Height = info.Height
|
||||
};
|
||||
InkCanvas.SetLeft(img, info.Left);
|
||||
InkCanvas.SetTop(img, info.Top);
|
||||
inkCanvas.Children.Add(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fileStreamHasNoStroke)
|
||||
using (var ms = new MemoryStream(File.ReadAllBytes(filePath))) {
|
||||
ms.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
@@ -3,11 +3,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using Point = System.Windows.Point;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
|
||||
@@ -8,7 +8,6 @@ using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using File = System.IO.File;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Ink;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Interop;
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
@@ -2165,5 +2164,30 @@ namespace Ink_Canvas {
|
||||
Settings.PowerPointSettings.EnableWppProcessKill = ToggleSwitchEnableWppProcessKill.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchCompressPicturesUploaded_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Canvas.IsCompressPicturesUploaded = ToggleSwitchCompressPicturesUploaded.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchAutoFoldAfterPPTSlideShow_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
Settings.Automation.IsAutoFoldAfterPPTSlideShow = ToggleSwitchAutoFoldAfterPPTSlideShow.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchAlwaysGoToFirstPageOnReenter_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
Settings.PowerPointSettings.IsAlwaysGoToFirstPageOnReenter = ToggleSwitchAlwaysGoToFirstPageOnReenter.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchAutoEnterAnnotationAfterKillHite_Toggled(object sender, RoutedEventArgs e) {
|
||||
if (!isLoaded) return;
|
||||
Settings.Automation.IsAutoEnterAnnotationAfterKillHite = ToggleSwitchAutoEnterAnnotationAfterKillHite.IsOn;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ using System.Windows.Ink;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||
using File = System.IO.File;
|
||||
using OperatingSystem = OSVersionExtension.OperatingSystem;
|
||||
|
||||
@@ -376,6 +375,7 @@ namespace Ink_Canvas {
|
||||
ToggleSwitchAutoSaveScreenShotInPowerPoint.IsOn =
|
||||
Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint;
|
||||
ToggleSwitchEnableWppProcessKill.IsOn = Settings.PowerPointSettings.EnableWppProcessKill;
|
||||
ToggleSwitchAlwaysGoToFirstPageOnReenter.IsOn = Settings.PowerPointSettings.IsAlwaysGoToFirstPageOnReenter;
|
||||
} else {
|
||||
Settings.PowerPointSettings = new PowerPointSettings();
|
||||
}
|
||||
@@ -549,6 +549,7 @@ namespace Ink_Canvas {
|
||||
|
||||
// 初始化直线端点吸附相关设置
|
||||
ToggleSwitchLineEndpointSnapping.IsOn = Settings.Canvas.LineEndpointSnapping;
|
||||
ToggleSwitchCompressPicturesUploaded.IsOn = Settings.Canvas.IsCompressPicturesUploaded;
|
||||
} else {
|
||||
Settings.Canvas = new Canvas();
|
||||
}
|
||||
@@ -683,6 +684,8 @@ namespace Ink_Canvas {
|
||||
|
||||
ToggleSwitchAutoFoldInPPTSlideShow.IsOn = Settings.Automation.IsAutoFoldInPPTSlideShow;
|
||||
|
||||
ToggleSwitchAutoFoldAfterPPTSlideShow.IsOn = Settings.Automation.IsAutoFoldAfterPPTSlideShow;
|
||||
|
||||
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService ||
|
||||
Settings.Automation.IsAutoKillHiteAnnotation || Settings.Automation.IsAutoKillInkCanvas
|
||||
|| Settings.Automation.IsAutoKillICA || Settings.Automation.IsAutoKillIDT ||
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
@@ -130,6 +129,16 @@ namespace Ink_Canvas {
|
||||
if (canvas.Strokes.Contains(currentStroke))
|
||||
canvas.Strokes.Remove(currentStroke);
|
||||
}
|
||||
} else if (item.CommitType == TimeMachineHistoryType.ElementInsert) {
|
||||
if (!item.StrokeHasBeenCleared) {
|
||||
// Undo: 移除元素
|
||||
if (item.InsertedElement != null && inkCanvas.Children.Contains(item.InsertedElement))
|
||||
inkCanvas.Children.Remove(item.InsertedElement);
|
||||
} else {
|
||||
// Redo: 添加元素
|
||||
if (item.InsertedElement != null && !inkCanvas.Children.Contains(item.InsertedElement))
|
||||
inkCanvas.Children.Add(item.InsertedElement);
|
||||
}
|
||||
}
|
||||
|
||||
_currentCommitType = CommitReason.UserInput;
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
@@ -151,6 +150,10 @@ namespace Ink_Canvas {
|
||||
if (arg.Contains("HiteAnnotation")) {
|
||||
Dispatcher.Invoke(() => {
|
||||
ShowNotification("“鸿合屏幕书写”已自动关闭");
|
||||
if (Settings.Automation.IsAutoKillHiteAnnotation && Settings.Automation.IsAutoEnterAnnotationAfterKillHite) {
|
||||
// 自动进入批注状态
|
||||
PenIcon_Click(null, null);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Windows.Ink;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Point = System.Windows.Point;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Ink_Canvas {
|
||||
public partial class MainWindow : Window {
|
||||
@@ -71,8 +72,11 @@ namespace Ink_Canvas {
|
||||
double boundWidth = e.GetTouchPoint(null).Bounds.Width, eraserMultiplier = 1.0;
|
||||
if (!Settings.Advanced.EraserBindTouchMultiplier && Settings.Advanced.IsSpecialScreen)
|
||||
eraserMultiplier = 1 / Settings.Advanced.TouchMultiplier;
|
||||
if ((Settings.Advanced.TouchMultiplier != 0 || !Settings.Advanced.IsSpecialScreen)) //启用特殊屏幕且触摸倍数为 0 时禁用橡皮
|
||||
|
||||
if ((Settings.Advanced.TouchMultiplier != 0 || !Settings.Advanced.IsSpecialScreen) //启用特殊屏幕且触摸倍数为 0 时禁用橡皮
|
||||
|
||||
// 修复:只有多指且面积大时才允许手掌擦,单指始终为批注
|
||||
if (dec != null && dec.Count >= 2 && (Settings.Advanced.TouchMultiplier != 0 || !Settings.Advanced.IsSpecialScreen)
|
||||
&& boundWidth > BoundsWidth * 2.5) {
|
||||
if (drawingShapeMode == 0 && forceEraser) return;
|
||||
currentPalmEraserShape = GetPalmRectangleEraserShape(eraserMultiplier);
|
||||
@@ -82,14 +86,16 @@ namespace Ink_Canvas {
|
||||
if (inkCanvas.EditingMode != InkCanvasEditingMode.EraseByPoint) {
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByPoint;
|
||||
}
|
||||
Trace.WriteLine($"[PalmEraser] 触发手掌擦: TouchId={e.TouchDevice.Id}, boundWidth={boundWidth:F2}, eraserMultiplier={eraserMultiplier:F2}, EraserShape={currentPalmEraserShape?.GetType().Name}, TouchCount={dec.Count}");
|
||||
}
|
||||
else {
|
||||
TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.None;
|
||||
// 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
|
||||
inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
|
||||
if (inkCanvas.EditingMode != InkCanvasEditingMode.EraseByPoint) {
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
}
|
||||
Trace.WriteLine($"[PalmEraser] 非手掌擦: TouchId={e.TouchDevice.Id}, boundWidth={boundWidth:F2}, eraserMultiplier={eraserMultiplier:F2}, TouchCount={(dec != null ? dec.Count : 0)}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,10 +357,12 @@ namespace Ink_Canvas {
|
||||
if (prePalmEraserEditingMode == InkCanvasEditingMode.Ink) {
|
||||
// 模拟点击批注选项卡
|
||||
PenIcon_Click(null, null);
|
||||
HideSubPanels("pen", true); // 新增:确保高光切换
|
||||
} else if (prePalmEraserEditingMode == InkCanvasEditingMode.None ||
|
||||
prePalmEraserEditingMode == InkCanvasEditingMode.Select) {
|
||||
// 模拟点击光标选项卡
|
||||
CursorIcon_Click(null, null);
|
||||
HideSubPanels("cursor", true); // 新增:确保高光切换
|
||||
} else {
|
||||
// 其他编辑模式时恢复之前的模式
|
||||
inkCanvas.EditingMode = prePalmEraserEditingMode;
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media.Animation;
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
|
||||
namespace Ink_Canvas
|
||||
|
||||
@@ -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("1.7.1.6")]
|
||||
[assembly: AssemblyFileVersion("1.7.1.6")]
|
||||
[assembly: AssemblyVersion("1.7.1.10")]
|
||||
[assembly: AssemblyFileVersion("1.7.1.10")]
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ink_Canvas
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
public static class ChickenSoup {
|
||||
public static string[] OSUPlayerYuLu = new string[] {
|
||||
|
||||
@@ -75,6 +75,8 @@ namespace Ink_Canvas
|
||||
|
||||
[JsonProperty("hyperbolaAsymptoteOption")]
|
||||
public OptionalOperation HyperbolaAsymptoteOption { get; set; } = OptionalOperation.Ask;
|
||||
[JsonProperty("isCompressPicturesUploaded")]
|
||||
public bool IsCompressPicturesUploaded { get; set; } = false;
|
||||
}
|
||||
|
||||
public enum OptionalOperation
|
||||
@@ -237,6 +239,8 @@ namespace Ink_Canvas
|
||||
public bool IsSupportWPS { get; set; } = true;
|
||||
[JsonProperty("enableWppProcessKill")]
|
||||
public bool EnableWppProcessKill { get; set; } = true;
|
||||
[JsonProperty("isAlwaysGoToFirstPageOnReenter")]
|
||||
public bool IsAlwaysGoToFirstPageOnReenter { get; set; } = false;
|
||||
}
|
||||
|
||||
public class Automation
|
||||
@@ -321,6 +325,9 @@ namespace Ink_Canvas
|
||||
[JsonProperty("isAutoFoldInPPTSlideShow")]
|
||||
public bool IsAutoFoldInPPTSlideShow { get; set; } = false;
|
||||
|
||||
[JsonProperty("isAutoFoldAfterPPTSlideShow")]
|
||||
public bool IsAutoFoldAfterPPTSlideShow { get; set; } = false;
|
||||
|
||||
[JsonProperty("isAutoKillPptService")]
|
||||
public bool IsAutoKillPptService { get; set; } = false;
|
||||
|
||||
@@ -371,6 +378,9 @@ namespace Ink_Canvas
|
||||
|
||||
[JsonProperty("isSaveFullPageStrokes")]
|
||||
public bool IsSaveFullPageStrokes = false;
|
||||
|
||||
[JsonProperty("isAutoEnterAnnotationAfterKillHite")]
|
||||
public bool IsAutoEnterAnnotationAfterKillHite { get; set; } = false;
|
||||
}
|
||||
|
||||
public class Advanced
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using System;
|
||||
using System.Media;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using iNKORE.UI.WPF.Modern.Controls.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
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.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using Ink_Canvas.Helpers.Plugins;
|
||||
using Ink_Canvas.Helpers.Plugins.BuiltIn;
|
||||
using Ink_Canvas.Helpers.Plugins.BuiltIn.SuperLauncher;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
@@ -12,7 +12,7 @@ TRACE;DEBUG;NETFRAMEWORK;NET472;;NET30_OR_GREATER;NET35_OR_GREATER;NET40_OR_GREA
|
||||
E:\ICC CE\ICC CE main\community\Ink Canvas\App.xaml
|
||||
21348134359
|
||||
|
||||
74373288771
|
||||
752071346691
|
||||
471037513499
|
||||
Helpers\Plugins\BuiltIn\SuperLauncher\LauncherSettingsControl.xaml;Helpers\Plugins\BuiltIn\SuperLauncher\LauncherWindow.xaml;MainWindow.xaml;MainWindow_cs\MW_Eraser.xaml;Resources\DrawShapeImageDictionary.xaml;Resources\IconImageDictionary.xaml;Resources\SeewoImageDictionary.xaml;Resources\Styles\Dark.xaml;Resources\Styles\Light.xaml;Windows\AddCustomIconWindow.xaml;Windows\AddPickNameBackgroundWindow.xaml;Windows\CountdownTimerWindow.xaml;Windows\CustomIconWindow.xaml;Windows\CycleProcessBar.xaml;Windows\HasNewUpdateWindow.xaml;Windows\ManagePickNameBackgroundsWindow.xaml;Windows\NamesInputWindow.xaml;Windows\OperatingGuideWindow.xaml;Windows\PluginSettingsWindow.xaml;Windows\RandWindow.xaml;Windows\YesOrNoNotificationWindow.xaml;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user