This commit is contained in:
XY Wang 2023-09-29 10:29:46 +08:00
commit e8a5c9e68d
6 changed files with 230 additions and 76 deletions

View File

@ -414,6 +414,12 @@
</ComboBox>
<ui:ToggleSwitch Header="手指模式" IsOn="{Binding ElementName=ToggleSwitchModeFinger, Path=IsOn}" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关"/>
<TextBlock Text="此选项仅适用于可获取触摸面积的屏幕" TextWrapping="Wrap" Foreground="#666666"/>
<TextBlock Text="橡皮模式" FontFamily="Microsoft YaHei UI" FontSize="14"/>
<ComboBox Name="ComboBoxEraserType" FontFamily="Microsoft YaHei UI" SelectedIndex="0" SelectionChanged="ComboBoxEraserType_OnSelectionChanged">
<ComboBoxItem Content="交叉切换" FontFamily="Microsoft YaHei UI"/>
<ComboBoxItem Content="面积擦" FontFamily="Microsoft YaHei UI"/>
<ComboBoxItem Content="笔画擦" FontFamily="Microsoft YaHei UI"/>
</ComboBox>
<TextBlock Text="橡皮大小" FontFamily="Microsoft YaHei UI" FontSize="14"/>
<ComboBox Name="ComboBoxEraserSize" FontFamily="Microsoft YaHei UI" SelectedIndex="2" SelectionChanged="ComboBoxEraserSize_SelectionChanged">
<ComboBoxItem Content="小" FontFamily="Microsoft YaHei UI"/>
@ -523,7 +529,16 @@
FontSize="14" Width="30" HorizontalAlignment="Center"
Visibility="{Binding Path=Visibility, ElementName=TouchMultiplierSlider, Mode=OneWay}"/>
</StackPanel>
<ui:SimpleStackPanel Spacing="8" Margin="0,4,0,4" Visibility="{Binding Visibility,ElementName=TouchMultiplierSlider}">
<TextBlock FontSize="14" Text="在下方用笔尖点击以估计触摸大小倍数"/>
<TextBlock Text="数值仅供参考" Foreground="#666666"/>
<Border CornerRadius="4" Height="48" Background="#cccccc" TouchDown="BorderCalculateMultiplier_TouchDown"/>
<TextBlock Name="TextBlockShowCalculatedMultiplier" FontSize="14"/>
</ui:SimpleStackPanel>
<ui:ToggleSwitch Name="ToggleSwitchEraserBindTouchMultiplier" Header="橡皮擦绑定触摸大小倍数" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" IsOn="False" Toggled="ToggleSwitchEraserBindTouchMultiplier_Toggled" Visibility="{Binding Path=Visibility, ElementName=TouchMultiplierSlider, Mode=OneWay}"/>
<ui:ToggleSwitch Name="ToggleSwitchIsQuadIR" Header="四边红外模式" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchIsQuadIR_Toggled"/>
<ui:ToggleSwitch Name="ToggleSwitchIsLogEnabled" Header="记录日志" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" IsOn="True" Toggled="ToggleSwitchIsLogEnabled_Toggled"/>
</ui:SimpleStackPanel>
</GroupBox>
@ -902,7 +917,7 @@
</Border>
<Border x:Name="PptNavigationBtn" Width="36" Height="36" CornerRadius="5" Background="{DynamicResource ToolBarBackground}" BorderThickness="1" BorderBrush="{DynamicResource ToolBarBorderBrush}">
<Grid MouseUp="PPTNavigationBtn_Click">
<TextBlock Name="PptNavigationTextBlock" FontSize="10" Foreground="#FF666666" HorizontalAlignment="Center" VerticalAlignment="Center" Text="0/0" />
<TextBlock Name="PptNavigationTextBlock" FontSize="10" Foreground="{DynamicResource ToolBarForeground}" HorizontalAlignment="Center" VerticalAlignment="Center" Text="0/0" />
</Grid>
</Border>
<Border Width="36" MouseUp="GridPPTControlNext_MouseUp" Height="36" CornerRadius="5" Background="{DynamicResource ToolBarBackground}" BorderThickness="1" BorderBrush="{DynamicResource ToolBarBorderBrush}">

View File

@ -107,6 +107,7 @@ namespace Ink_Canvas
{
try
{
// 希沃相关: easinote swenserver RemoteProcess EasiNote.MediaHttpService smartnote.cloud EasiUpdate smartnote EasiUpdate3 EasiUpdate3Protect SeewoP2P CefSharp.BrowserSubprocess SeewoUploadService
string arg = "/F";
if (Settings.Automation.IsAutoKillPptService)
{
@ -115,6 +116,12 @@ namespace Ink_Canvas
{
arg += " /IM PPTService.exe";
}
processes = Process.GetProcessesByName("SeewoIwbAssistant");
if (processes.Length > 0)
{
arg += " /IM SeewoIwbAssistant.exe" +
" /IM Sia.Guard";
}
}
if (Settings.Automation.IsAutoKillEasiNote)
{
@ -906,6 +913,19 @@ namespace Ink_Canvas
BtnSwitchTheme.Content = "深色";
BtnSwitchTheme_Click(null, null);
}
switch (Settings.Canvas.EraserType)
{
case 1:
forcePointEraser = true;
break;
case 2:
forcePointEraser = false;
break;
}
ComboBoxEraserType.SelectedIndex = Settings.Canvas.EraserType;
if (Settings.PowerPointSettings.IsAutoSaveScreenShotInPowerPoint)
{
ToggleSwitchAutoSaveScreenShotInPowerPoint.IsOn = true;
@ -949,6 +969,8 @@ namespace Ink_Canvas
ToggleSwitchIsSpecialScreen.IsOn = false;
}
TouchMultiplierSlider.Visibility = ToggleSwitchIsSpecialScreen.IsOn ? Visibility.Visible : Visibility.Collapsed;
ToggleSwitchIsQuadIR.IsOn = Settings.Advanced.IsQuadIR;
}
else
{
@ -1014,10 +1036,22 @@ namespace Ink_Canvas
{
forceEraser = true;
forcePointEraser = !forcePointEraser;
inkCanvas.EditingMode = forcePointEraser ? InkCanvasEditingMode.EraseByPoint : InkCanvasEditingMode.EraseByStroke;
switch (Settings.Canvas.EraserType)
{
case 1:
forcePointEraser = true;
break;
case 2:
forcePointEraser = false;
break;
}
inkCanvas.EditingMode =
forcePointEraser ? InkCanvasEditingMode.EraseByPoint : InkCanvasEditingMode.EraseByStroke;
inkCanvas.EraserShape = forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5);
drawingShapeMode = 0;
GeometryDrawingEraser.Brush = forcePointEraser ? new SolidColorBrush(Color.FromRgb(0x23, 0xA9, 0xF2)) : new SolidColorBrush(Color.FromRgb(0x66, 0x66, 0x66));
GeometryDrawingEraser.Brush = forcePointEraser
? new SolidColorBrush(Color.FromRgb(0x23, 0xA9, 0xF2))
: new SolidColorBrush(Color.FromRgb(0x66, 0x66, 0x66));
ImageEraser.Visibility = Visibility.Collapsed;
inkCanvas_EditingModeChanged(inkCanvas, null);
CancelSingleFingerDragMode();
@ -1458,9 +1492,6 @@ namespace Ink_Canvas
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
CancelSingleFingerDragMode();
forceEraser = false;
}
isLongPressSelected = false;
// 改变选中提示
ViewboxBtnColorBlackContent.Visibility = Visibility.Collapsed;
@ -1492,6 +1523,9 @@ namespace Ink_Canvas
}
}
isLongPressSelected = false;
}
private void BtnColorBlack_Click(object sender, RoutedEventArgs e)
{
inkColor = 0;
@ -1794,10 +1828,12 @@ namespace Ink_Canvas
}
else
{
inkCanvas.EraserShape = forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5);
//inkCanvas.EraserShape = new RectangleStylusShape(8, 8);
//inkCanvas.EraserShape = new EllipseStylusShape(boundsWidth * 1.5, boundsWidth * 1.5);
inkCanvas.EditingMode = forcePointEraser ? InkCanvasEditingMode.EraseByPoint : InkCanvasEditingMode.EraseByStroke;
//inkCanvas.EraserShape = new RectangleStylusShape(8, 8); //old old
//inkCanvas.EraserShape = forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5); //last
//inkCanvas.EraserShape = new EllipseStylusShape(boundsWidth * 1.5, boundsWidth * 1.5); //old old
//inkCanvas.EditingMode = forcePointEraser ? InkCanvasEditingMode.EraseByPoint : InkCanvasEditingMode.EraseByStroke; //last
inkCanvas.EraserShape = new EllipseStylusShape(5, 5);
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
}
}
}
@ -1813,7 +1849,9 @@ namespace Ink_Canvas
public double GetTouchBoundWidth(TouchEventArgs e)
{
var args = e.GetTouchPoint(null).Bounds;
double value = args.Width;
double value;
if (!Settings.Advanced.IsQuadIR) value = args.Width;
else value = Math.Sqrt(args.Width * args.Height); //四边红外
if (Settings.Advanced.IsSpecialScreen) value *= Settings.Advanced.TouchMultiplier;
return value;
}
@ -2831,6 +2869,14 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
private void ComboBoxEraserType_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!isLoaded) return;
Settings.Canvas.EraserType = ComboBoxEraserType.SelectedIndex;
SaveSettingsToFile();
}
private void InkWidthSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!isLoaded) return;
@ -3127,6 +3173,16 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
private void BorderCalculateMultiplier_TouchDown(object sender, TouchEventArgs e)
{
var args = e.GetTouchPoint(null).Bounds;
double value;
if (!Settings.Advanced.IsQuadIR) value = args.Width;
else value = Math.Sqrt(args.Width * args.Height); //四边红外
TextBlockShowCalculatedMultiplier.Text = (5 / (value * 1.1)).ToString();
}
private void ToggleSwitchEraserBindTouchMultiplier_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
@ -3134,6 +3190,13 @@ namespace Ink_Canvas
SaveSettingsToFile();
}
private void ToggleSwitchIsQuadIR_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.Advanced.IsQuadIR = ToggleSwitchIsQuadIR.IsOn;
SaveSettingsToFile();
}
private void ToggleSwitchIsLogEnabled_Toggled(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
@ -5449,6 +5512,36 @@ namespace Ink_Canvas
}
}
}
else if (item.CommitType == TimeMachineHistoryType.Rotate)
{
if (item.StrokeHasBeenCleared)
{
foreach (var strokes in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(strokes))
inkCanvas.Strokes.Remove(strokes);
}
foreach (var strokes in item.ReplacedStroke)
{
if (!inkCanvas.Strokes.Contains(strokes))
inkCanvas.Strokes.Add(strokes);
}
}
else
{
foreach (var strokes in item.CurrentStroke)
{
if (!inkCanvas.Strokes.Contains(strokes))
inkCanvas.Strokes.Add(strokes);
}
foreach (var strokes in item.ReplacedStroke)
{
if (inkCanvas.Strokes.Contains(strokes))
inkCanvas.Strokes.Remove(strokes);
}
}
}
else if (item.CommitType == TimeMachineHistoryType.Clear)
{
if (!item.StrokeHasBeenCleared)
@ -5472,13 +5565,6 @@ namespace Ink_Canvas
}
else
{
if (item.CurrentStroke != null)
{
foreach (var currentStroke in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
}
}
if (item.ReplacedStroke != null)
{
foreach (var replacedStroke in item.ReplacedStroke)
@ -5486,11 +5572,18 @@ namespace Ink_Canvas
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
}
}
if (item.CurrentStroke != null)
{
foreach (var currentStroke in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
}
}
}
}
_currentCommitType = CommitReason.UserInput;
}
}
else
{
_currentCommitType = CommitReason.CodeInput;
@ -5546,6 +5639,36 @@ namespace Ink_Canvas
}
}
}
else if (item.CommitType == TimeMachineHistoryType.Rotate)
{
if (item.StrokeHasBeenCleared)
{
foreach (var strokes in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(strokes))
inkCanvas.Strokes.Remove(strokes);
}
foreach (var strokes in item.ReplacedStroke)
{
if (!inkCanvas.Strokes.Contains(strokes))
inkCanvas.Strokes.Add(strokes);
}
}
else
{
foreach (var strokes in item.CurrentStroke)
{
if (!inkCanvas.Strokes.Contains(strokes))
inkCanvas.Strokes.Add(strokes);
}
foreach (var strokes in item.ReplacedStroke)
{
if (inkCanvas.Strokes.Contains(strokes))
inkCanvas.Strokes.Remove(strokes);
}
}
}
else if (item.CommitType == TimeMachineHistoryType.Clear)
{
if (!item.StrokeHasBeenCleared)
@ -5569,13 +5692,6 @@ namespace Ink_Canvas
}
else
{
if (item.CurrentStroke != null)
{
foreach (var currentStroke in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
}
}
if (item.ReplacedStroke != null)
{
foreach (var replacedStroke in item.ReplacedStroke)
@ -5583,9 +5699,15 @@ namespace Ink_Canvas
if (!inkCanvas.Strokes.Contains(replacedStroke)) inkCanvas.Strokes.Add(replacedStroke);
}
}
if (item.CurrentStroke != null)
{
foreach (var currentStroke in item.CurrentStroke)
{
if (inkCanvas.Strokes.Contains(currentStroke)) inkCanvas.Strokes.Remove(currentStroke);
}
}
}
}
}
_currentCommitType = CommitReason.UserInput;
}
@ -6600,7 +6722,7 @@ namespace Ink_Canvas
public static void ShowNewMessage(string notice, bool isShowImmediately = true)
{
(Application.Current?.Windows.Cast<Window>().FirstOrDefault(window => window is MainWindow) as MainWindow).ShowNotification(notice, isShowImmediately);
(Application.Current?.Windows.Cast<Window>().FirstOrDefault(window => window is MainWindow) as MainWindow)?.ShowNotification(notice, isShowImmediately);
}
public void ShowNotification(string notice, bool isShowImmediately = true)
@ -6790,6 +6912,7 @@ namespace Ink_Canvas
{
BtnSelect_Click(BtnSelect, null);
ImageEraser.Visibility = Visibility.Visible;
ViewboxBtnColorBlackContent.Visibility = Visibility.Collapsed;
ViewboxBtnColorBlueContent.Visibility = Visibility.Collapsed;
ViewboxBtnColorGreenContent.Visibility = Visibility.Collapsed;
@ -7236,6 +7359,7 @@ namespace Ink_Canvas
#endregion
}
#region Test for pen

View File

@ -32,7 +32,8 @@ namespace Ink_Canvas
public int InkStyle { get; set; } = 0;
[JsonProperty("eraserSize")]
public int EraserSize { get; set; } = 2;
[JsonProperty("eraserType")]
public int EraserType { get; set; } = 0; // 0 - 图标切换模式 1 - 面积擦 2 - 线条擦
[JsonProperty("hideStrokeWhenSelecting")]
public bool HideStrokeWhenSelecting { get; set; } = true;
@ -144,6 +145,8 @@ namespace Ink_Canvas
{
[JsonProperty("isSpecialScreen")]
public bool IsSpecialScreen { get; set; } = false;
[JsonProperty("isQuadIR")]
public bool IsQuadIR { get; set; } = false;
[JsonProperty("touchMultiplier")]
public double TouchMultiplier { get; set; } = 0.25;
[JsonProperty("eraserBindTouchMultiplier")]

View File

@ -16,13 +16,14 @@ Ink Canvas 画板是一款轻量级画板软件,其针对希沃白板设备进
### Ink Canvas 模式
* **幻灯片模式**
* 在幻灯片模式下支持画笔、橡皮擦、图形工具、快捷翻页按键、换页换笔迹等功能
* 在幻灯片模式下支持画笔、橡皮擦、图形工具、快捷翻页按键、换页自动换笔迹等功能
* 自动保存幻灯片下的墨迹,下次打开时墨迹将自动恢复,并且随时可修改。
* 如果有隐藏的幻灯片页面,将询问是否取消隐藏
* **画板模式(黑板模式)**
* **画板模式(黑/白板模式)**
* 在画板模式下有着一整个类似希沃白板一样的画板
* 支持添加新页面和页面切换
* 支持多指书写:黑板模式界面左下角人像图标为切换按钮
* 默认是黑板,可以在设置中调成白板
* **屏幕画笔模式**
* 在屏幕画笔模式下可以显示原屏幕内容的同时将鼠标调为画笔书写授课笔迹
@ -35,7 +36,7 @@ Ink Canvas 画板是一款轻量级画板软件,其针对希沃白板设备进
* 自动查杀希沃部分软件
* 单条或多条墨迹选中后缩放、旋转、移动、克隆
* 全屏幕笔迹双指手势缩放(旋转和拖动也是双指手势)
* 图形绘制
* 图形绘制(支持长按一直选中)
直线、虚线、带箭头直线
多条平行线,带焦点和不带焦点的椭圆、双曲线、抛物线。
正圆、虚线圆,圆柱、圆锥、长方体
@ -53,7 +54,14 @@ Ink Canvas 画板是一款轻量级画板软件,其针对希沃白板设备进
## 用法 <span id='usage'></span>
### 画笔设置
* **颜色**:在“画笔模式”下直接点击主界面的颜色球即可
* **粗细**点击“设置”齿轮在“画板”——“画笔粗细”中调整默认5
* **笔锋**:在“设置”齿轮中,有根据“速度”和“尾迹”绘制笔锋,让笔迹更美观
### 橡皮擦使用
* **笔迹擦除**:单击一次使图标变为灰色可按笔迹擦除内容
* **范围擦除**:单击多一次使图标变蓝色可按提示图案范围擦除
* **手掌擦除**:在画笔模式下按压手掌即可起到橡皮擦擦除功能(部分屏幕不支持)
### 绘制预设图形
* **正圆**:确定圆心时可选用预设在“原点”位置点击,再拖动鼠标完成正圆绘制
* **抛物线**:可以在“原点”位置点击,再拖动鼠标
@ -64,9 +72,12 @@ Ink Canvas 画板是一款轻量级画板软件,其针对希沃白板设备进
* **平面直角坐标系**:有多种预设,图标中两线交点上下左右的长边为实际绘制边。
* **空间直角坐标系**:三轴同时绘制
* **平行线**:从一端到另一端,适合绘制匀强电场的电场线,并针对特殊角度优化
### ppt放映模式
* **翻页**:屏幕中无笔迹时可以多指并排上下滑动翻页,以及控件和键盘方向键翻页
* **保存**ppt中的笔迹自动保存还可以移动笔迹文件夹到其他电脑正常使用原笔迹
ppt模式下打开的内置画板和正常打开的画板一样的可能需要用户自行关注保存问题
### 自动墨迹识别Ink To Shape)
1. 尽可能画得准确
1. 尽可能画得标准和规范一些
2. 正圆内画椭圆,可完成截面圆、同心椭圆(适用于天体轨迹)的识别
3. 可自动完成同心圆、相切圆的识别(内切、外切)

View File

@ -26,7 +26,7 @@ A fantastic Ink Canvas in WPF/C#, with fantastic support for Seewo Boards.
## ⚠️ 提示
- 提问前请先读[FAQ](https://github.com/WXRIW/Ink-Canvas#FAQ "FAQ")
- 遇到问题请先尝试自行解决,如果有没法自行解决的问题请先冷静下来提问,使用简洁的语言,描述你的期望与现实的差异性。如果有必要,请附上复现此问题的操作步骤或错误日志¹ (可适当配图),等待大佬们的回复。
- 遇到问题请先尝试自行解决,若无法自行解决,请简单描述你的期望与现实的差异性。如果有必要,请附上复现此问题的操作步骤或错误日志¹ (可适当配图),等待回复。
- 对新功能的有效意见和合理建议开发者会适时回复并进行开发。Ink Canvas并非商业性质的软件请勿催促开发者耐心才能让功能更少BUG、更加稳定。
> 等待是人类的一种智慧
@ -48,17 +48,18 @@ A fantastic Ink Canvas in WPF/C#, with fantastic support for Seewo Boards.
### **安装后**程序无法正常启动?
请检查你的电脑上是否安装了 `.Net Framework 4.7.2` 或更高版本。若没有,请前往官网下载
如果仍无法运行,请检查你的电脑上是否安装了 `Microsoft Office`。若没有,请安装后
如果仍无法运行,请检查你的电脑上是否安装了 `Microsoft Office`。若没有,请安装后
### 我该如何提出功能需求和错误报告?
### 我该在何处提出功能需求和错误报告?
1. 你可以选择在GitHub issues里提出
1. GitHub Issues
功能需求https://github.com/WXRIW/Ink-Canvas/labels/enhancement/new
错误报告https://github.com/WXRIW/Ink-Canvas/labels/bug/new
2. 你也可以加入 [![交流群](https://img.shields.io/badge/-%E4%BA%A4%E6%B5%81%E7%BE%A4%20891915376-blue?style=flat&logo=TencentQQ)](https://jq.qq.com/?_wv=1027&k=NvlM1Rgg) 进行探讨
2. Tencent QQ
[![交流群](https://img.shields.io/badge/-%E4%BA%A4%E6%B5%81%E7%BE%A4%20891915376-blue?style=flat&logo=TencentQQ)](https://jq.qq.com/?_wv=1027&k=NvlM1Rgg)
### 大小屏设备交替使用/手指或笔头过大 导致被识别成橡皮怎么办?
点击画板的“设置”按钮并开启`特殊屏幕`选项即可

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 148 KiB