Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad18277223 | |||
| 661fd21626 | |||
| d8fd231476 | |||
| 8d611a22a2 | |||
| 6cb8b188ec | |||
| d1d0e00959 | |||
| cbc317795e | |||
| ab88c34abc | |||
| 18b0556f7a | |||
| 7bea23005d | |||
| b46cbcc15f |
@@ -1,17 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Microsoft.VisualBasic;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Data;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ using System.Drawing;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
namespace Ink_Canvas {
|
namespace Ink_Canvas {
|
||||||
public partial class MainWindow : Window {
|
public partial class MainWindow : Window {
|
||||||
@@ -147,12 +148,18 @@ namespace Ink_Canvas {
|
|||||||
private void inkCanvas_EditingModeChanged(object sender, RoutedEventArgs e) {
|
private void inkCanvas_EditingModeChanged(object sender, RoutedEventArgs e) {
|
||||||
var inkCanvas1 = sender as InkCanvas;
|
var inkCanvas1 = sender as InkCanvas;
|
||||||
if (inkCanvas1 == null) return;
|
if (inkCanvas1 == null) return;
|
||||||
|
// 修复“显示画笔光标”选项不可用的问题
|
||||||
if (Settings.Canvas.IsShowCursor) {
|
if (Settings.Canvas.IsShowCursor) {
|
||||||
if (inkCanvas1.EditingMode == InkCanvasEditingMode.Ink || drawingShapeMode != 0)
|
inkCanvas1.UseCustomCursor = true;
|
||||||
|
// 修复触屏和数位笔时光标不显示:只要有输入设备悬停、捕获,或有任何Stylus设备连接就显示
|
||||||
|
if ((inkCanvas1.EditingMode == InkCanvasEditingMode.Ink || drawingShapeMode != 0)
|
||||||
|
&& (inkCanvas1.IsStylusDirectlyOver || inkCanvas1.IsMouseDirectlyOver || inkCanvas1.IsStylusCaptured || inkCanvas1.IsMouseCaptured
|
||||||
|
|| Stylus.CurrentStylusDevice != null))
|
||||||
inkCanvas1.ForceCursor = true;
|
inkCanvas1.ForceCursor = true;
|
||||||
else
|
else
|
||||||
inkCanvas1.ForceCursor = false;
|
inkCanvas1.ForceCursor = false;
|
||||||
} else {
|
} else {
|
||||||
|
inkCanvas1.UseCustomCursor = false;
|
||||||
inkCanvas1.ForceCursor = false;
|
inkCanvas1.ForceCursor = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ namespace Ink_Canvas {
|
|||||||
if (Settings.Automation.IsAutoSaveStrokesAtClear &&
|
if (Settings.Automation.IsAutoSaveStrokesAtClear &&
|
||||||
inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) SaveScreenShot(true);
|
inkCanvas.Strokes.Count > Settings.Automation.MinimumAutomationStrokeNumber) SaveScreenShot(true);
|
||||||
if (CurrentWhiteboardIndex >= WhiteboardTotalCount) {
|
if (CurrentWhiteboardIndex >= WhiteboardTotalCount) {
|
||||||
|
// 在最后一页时,点击“新页面”按钮直接新增一页
|
||||||
BtnWhiteBoardAdd_Click(sender, e);
|
BtnWhiteBoardAdd_Click(sender, e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -166,64 +167,35 @@ namespace Ink_Canvas {
|
|||||||
TextBlockWhiteBoardIndexInfo.Text =
|
TextBlockWhiteBoardIndexInfo.Text =
|
||||||
$"{CurrentWhiteboardIndex}/{WhiteboardTotalCount}";
|
$"{CurrentWhiteboardIndex}/{WhiteboardTotalCount}";
|
||||||
|
|
||||||
if (CurrentWhiteboardIndex == WhiteboardTotalCount) {
|
bool isLastPage = CurrentWhiteboardIndex == WhiteboardTotalCount;
|
||||||
var newImageSource = new BitmapImage();
|
bool isMaxPage = WhiteboardTotalCount >= 99;
|
||||||
newImageSource.BeginInit();
|
|
||||||
newImageSource.UriSource = new Uri("/Resources/Icons-Fluent/ic_fluent_add_circle_24_regular.png",
|
// 设置按钮文本
|
||||||
UriKind.RelativeOrAbsolute);
|
BtnLeftWhiteBoardSwitchNextLabel.Text = isLastPage ? "新页面" : "下一页";
|
||||||
newImageSource.EndInit();
|
BtnRightWhiteBoardSwitchNextLabel.Text = isLastPage ? "新页面" : "下一页";
|
||||||
//BoardLeftPannelNextPage.Source = newImageSource;
|
|
||||||
//BoardRightPannelNextPage.Source = newImageSource;
|
// 始终允许点击“下一页/新页面”按钮(除非已达最大页数)
|
||||||
//BoardRightPannelNextPageTextBlock.Text = "加页";
|
BtnWhiteBoardSwitchNext.IsEnabled = !isMaxPage;
|
||||||
//BoardLeftPannelNextPageTextBlock.Text = "加页";
|
|
||||||
} else {
|
// 保持按钮常亮(高亮)
|
||||||
var newImageSource = new BitmapImage();
|
BtnLeftWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
||||||
newImageSource.BeginInit();
|
BtnLeftWhiteBoardSwitchNextLabel.Opacity = 1;
|
||||||
newImageSource.UriSource =
|
BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
||||||
new Uri("/Resources/Icons-Fluent/ic_fluent_arrow_circle_right_24_regular.png",
|
BtnRightWhiteBoardSwitchNextLabel.Opacity = 1;
|
||||||
UriKind.RelativeOrAbsolute);
|
|
||||||
newImageSource.EndInit();
|
|
||||||
//BoardLeftPannelNextPage.Source = newImageSource;
|
|
||||||
//BoardRightPannelNextPage.Source = newImageSource;
|
|
||||||
//BoardRightPannelNextPageTextBlock.Text = "下一页";
|
|
||||||
//BoardLeftPannelNextPageTextBlock.Text = "下一页";
|
|
||||||
}
|
|
||||||
|
|
||||||
BtnWhiteBoardSwitchPrevious.IsEnabled = true;
|
BtnWhiteBoardSwitchPrevious.IsEnabled = true;
|
||||||
BtnWhiteBoardSwitchNext.IsEnabled = true;
|
|
||||||
|
|
||||||
if (CurrentWhiteboardIndex == 1) {
|
if (CurrentWhiteboardIndex == 1) {
|
||||||
BtnWhiteBoardSwitchPrevious.IsEnabled = false;
|
BtnWhiteBoardSwitchPrevious.IsEnabled = false;
|
||||||
BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
|
BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
|
||||||
BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 0.5;
|
BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 0.5;
|
||||||
BtnLeftWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
|
||||||
BtnLeftWhiteBoardSwitchNextLabel.Opacity = 1;
|
|
||||||
|
|
||||||
BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
|
BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
|
||||||
BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 0.5;
|
BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 0.5;
|
||||||
BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
|
||||||
BtnRightWhiteBoardSwitchNextLabel.Opacity = 1;
|
|
||||||
} else {
|
} else {
|
||||||
BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
BtnLeftWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
||||||
BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 1;
|
BtnLeftWhiteBoardSwitchPreviousLabel.Opacity = 1;
|
||||||
|
|
||||||
BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
BtnRightWhiteBoardSwitchPreviousGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
||||||
BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 1;
|
BtnRightWhiteBoardSwitchPreviousLabel.Opacity = 1;
|
||||||
|
|
||||||
if (CurrentWhiteboardIndex == WhiteboardTotalCount) {
|
|
||||||
BtnLeftWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
|
|
||||||
BtnLeftWhiteBoardSwitchNextLabel.Opacity = 0.5;
|
|
||||||
|
|
||||||
BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(127, 24, 24, 27));
|
|
||||||
BtnRightWhiteBoardSwitchNextLabel.Opacity = 0.5;
|
|
||||||
BtnWhiteBoardSwitchNext.IsEnabled = false;
|
|
||||||
} else {
|
|
||||||
BtnLeftWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
|
||||||
BtnLeftWhiteBoardSwitchNextLabel.Opacity = 1;
|
|
||||||
|
|
||||||
BtnRightWhiteBoardSwitchNextGeometry.Brush = new SolidColorBrush(Color.FromArgb(255, 24, 24, 27));
|
|
||||||
BtnRightWhiteBoardSwitchNextLabel.Opacity = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BtnWhiteBoardDelete.IsEnabled = WhiteboardTotalCount != 1;
|
BtnWhiteBoardDelete.IsEnabled = WhiteboardTotalCount != 1;
|
||||||
|
|||||||
@@ -29,16 +29,6 @@ namespace Ink_Canvas {
|
|||||||
|
|
||||||
private void BtnCheckPPT_Click(object sender, RoutedEventArgs e) {
|
private void BtnCheckPPT_Click(object sender, RoutedEventArgs e) {
|
||||||
try {
|
try {
|
||||||
pptApplication = null;
|
|
||||||
// 优先检测WPS(wpp.Application),获取不到再尝试PowerPoint
|
|
||||||
try {
|
|
||||||
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("wpp.Application");
|
|
||||||
} catch { }
|
|
||||||
if (pptApplication == null) {
|
|
||||||
try {
|
|
||||||
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Marshal.GetActiveObject("PowerPoint.Application");
|
|
||||||
} catch { }
|
|
||||||
}
|
|
||||||
if (pptApplication != null) {
|
if (pptApplication != null) {
|
||||||
//获得演示文稿对象
|
//获得演示文稿对象
|
||||||
presentation = pptApplication.ActivePresentation;
|
presentation = pptApplication.ActivePresentation;
|
||||||
@@ -138,8 +128,8 @@ namespace Ink_Canvas {
|
|||||||
pptApplication = null;
|
pptApplication = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果没有找到运行中的实例,则创建新实例
|
// 如果没有找到运行中的实例,则自动创建PowerPoint进程(仅在未启用WPS支持时)
|
||||||
if (pptApplication == null)
|
if (pptApplication == null && !isWPSSupportOn)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -147,22 +137,10 @@ namespace Ink_Canvas {
|
|||||||
Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B")));
|
Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B")));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
|
||||||
// 如果WPS支持开启,尝试创建WPS实例
|
|
||||||
if (isWPSSupportOn)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance(
|
|
||||||
Type.GetTypeFromProgID("wpp.Application"));
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
{
|
||||||
pptApplication = null;
|
pptApplication = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
isPowerPointInitialized = true;
|
isPowerPointInitialized = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -191,30 +169,25 @@ namespace Ink_Canvas {
|
|||||||
}
|
}
|
||||||
slide = null;
|
slide = null;
|
||||||
isPowerPointInitialized = false;
|
isPowerPointInitialized = false;
|
||||||
// 这里可以选择自动重启 PowerPoint 或 WPS 或等待用户操作
|
|
||||||
|
// PowerPoint进程守护:自动重启PowerPoint进程(仅在未启用WPS支持时)
|
||||||
|
if (!isWPSSupportOn)
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
|
||||||
if (isWpsMode)
|
|
||||||
{
|
|
||||||
// 自动重启WPS
|
|
||||||
Process.Start("wpp.exe");
|
|
||||||
Thread.Sleep(2000); // 等待WPS启动
|
|
||||||
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance(
|
|
||||||
Type.GetTypeFromProgID("wpp.Application"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance(
|
pptApplication = (Microsoft.Office.Interop.PowerPoint.Application)Activator.CreateInstance(
|
||||||
Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B")));
|
Marshal.GetTypeFromCLSID(new Guid("91493441-5A91-11CF-8700-00AA0060263B")));
|
||||||
}
|
|
||||||
isPowerPointInitialized = true;
|
isPowerPointInitialized = true;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LogHelper.WriteLogToFile("PowerPoint/WPS 守护重启失败: " + ex.ToString(), LogHelper.LogType.Error);
|
LogHelper.WriteLogToFile("PowerPoint 守护重启失败: " + ex.ToString(), LogHelper.LogType.Error);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 启用WPS支持时不守护PowerPoint进程
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -786,7 +759,7 @@ namespace Ink_Canvas {
|
|||||||
|
|
||||||
await Task.Delay(150);
|
await Task.Delay(150);
|
||||||
|
|
||||||
Application.Current.Dispatcher.InvokeAsync(() => {
|
await Application.Current.Dispatcher.InvokeAsync(() => {
|
||||||
ViewboxFloatingBarMarginAnimation(100, true);
|
ViewboxFloatingBarMarginAnimation(100, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ namespace Ink_Canvas {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.None;
|
TouchDownPointsList[e.TouchDevice.Id] = InkCanvasEditingMode.None;
|
||||||
|
// 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
|
||||||
|
inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
|
||||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -236,8 +238,8 @@ namespace Ink_Canvas {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
isLastTouchEraser = false;
|
isLastTouchEraser = false;
|
||||||
inkCanvas.EraserShape =
|
// 修复面积擦时不显示橡皮形状:无论 forcePointEraser 状态,均显示 50x50 橡皮
|
||||||
forcePointEraser ? new EllipseStylusShape(50, 50) : new EllipseStylusShape(5, 5);
|
inkCanvas.EraserShape = new EllipseStylusShape(50, 50);
|
||||||
if (forceEraser) return;
|
if (forceEraser) return;
|
||||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -21,6 +21,11 @@ ICC CE创立的初衷是因为作者使用ICC的过程中一些小BUG,于是
|
|||||||
说白了,我比较懒README懒得改了,就直接用之前ICC的了
|
说白了,我比较懒README懒得改了,就直接用之前ICC的了
|
||||||
高中生,更新不定期/doge
|
高中生,更新不定期/doge
|
||||||
|
|
||||||
|
## 相关信息
|
||||||
|
ICC CE交流群:QQ群1054377349
|
||||||
|
|
||||||
|
智教联盟 InkCanvasForClass Community Edition 板块:https://forum.smart-teach.cn/t/icc-ce
|
||||||
|
|
||||||
### 项目特点
|
### 项目特点
|
||||||
由初学者结合AI技术实现代码(说白了就是不会)
|
由初学者结合AI技术实现代码(说白了就是不会)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user